remove version check on merge to main #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish VSCode Extension | |
on: | |
push: | |
branches: | |
- main | |
- master | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Setup Environment | |
run: node -e "console.log('PACKAGE_VERSION=' + require('./package.json').version + '\nPACKAGE_NAME=' + require('./package.json').name + '-' + require('./package.json').version)" >> $GITHUB_ENV | |
- name: Install | |
run: yarn | |
- name: Package extension | |
run: yarn run package | |
- name: Publish Extension | |
run: yarn vsce publish --yarn --packagePath ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.MARKETPLACE_PAT }} | |
- name: Generate Changelog | |
id: changelog | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
version: ${{ env.PACKAGE_VERSION }} | |
path: ./CHANGELOG.md | |
- name: Create GitHub release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
name: v${{ env.PACKAGE_VERSION }} | |
body: ${{ steps.changelog.outputs.changes }} | |
draft: false | |
prerelease: false | |
files: ./${{ env.PACKAGE_NAME }}.vsix |