Skip to content

Commit

Permalink
fix: publish workflow (again) [skip action] (#6)
Browse files Browse the repository at this point in the history
skipping ci in order to trigger manually
  • Loading branch information
lewxdev authored Mar 15, 2024
1 parent d254bde commit de23276
Showing 1 changed file with 19 additions and 44 deletions.
63 changes: 19 additions & 44 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,63 +8,38 @@ on:
version:
description: The version to release (e.g. x.x.x or major, minor, patch)
required: false
no-publish:
type: boolean
description: Skip publishing to the marketplace
default: false

permissions:
contents: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check it
uses: actions/checkout@v4

- name: Prepare it
uses: actions/setup-node@v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npm clean-install

- name: Install it
run: npm clean-install

- name: Version it
if: ${{ github.event_name == 'workflow_dispatch' }} && ${{ github.event.inputs.version }}
- if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version }}
run: npm version ${{ github.event.inputs.version }} --no-git-tag-version

- name: Package it
id: package
run: |
- run: |
npm exec vsce package
echo "filename=$(ls *.vsix)" >> $GITHUB_OUTPUT
echo "filepath=$(ls *.vsix)" >> $GITHUB_ENV
echo "version=$(npm pkg get version)" >> $GITHUB_ENV
echo "preview=$(npm pkg get preview)" >> $GITHUB_ENV
- name: Publish it
- if: ${{ !github.event.inputs.no-publish }}
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: npm exec vsce publish -- --packagePath ${{ steps.package.outputs.filename }}
run: npm exec vsce publish -- --packagePath $filepath

- name: Configure it
id: config
run: |
echo "version=$(node --print "require('./package.json').version")" >> $GITHUB_OUTPUT
echo "preview=$(node --print "require('./package.json').preview")" >> $GITHUB_OUTPUT
- name: Release it
id: release
uses: actions/create-release@v1
env:
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.config.outputs.version }}
release_name: v${{ steps.config.outputs.version }}
prerelease: ${{ steps.config.outputs.preview }}
body: |
# v${{ steps.config.outputs.version }}
see [CHANGELOG.md](CHANGELOG.md) for details on this release
- name: Upload it
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_name: ${{ steps.package.outputs.filename }}
asset_path: ${{ steps.package.outputs.filename }}
asset_content_type: application/zip
run: gh release create v$version $filepath --generate-notes --prerelease=$preview

0 comments on commit de23276

Please sign in to comment.