Publish Extension #18
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 Extension | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Version | |
default: minor | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Install Dependencies # vsce etc | |
run: | # shell | |
npm i | |
- name: Build Extension # build `extension.js` and `*.wasm` files | |
run: | # shell | |
npm run build | |
- name: Setup Github Actions # allow use of `git push` | |
run: | # shell | |
git config --global user.name "RedCMD" | |
git config --global user.email "[email protected]" | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Sync Github Actions" | |
- name: Package Extension # `.vsix` file | |
run: | # shell | |
npx vsce package ${{ github.event.inputs.version }} | |
git push --follow-tags | |
echo "VERSION=$(node -p "require('./package.json').version")" >> "$GITHUB_ENV" | |
- name: Generate Release # create release page on github with `.vsix` file | |
run: | # shell | |
gh release create v$VERSION --generate-notes tmlanguage-syntax-highlighter-$VERSION.vsix | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Publish Release # upload to Extension Marketplace | |
run: | # shell | |
npx vsce publish --packagePath tmlanguage-syntax-highlighter-$VERSION.vsix | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} |