v1.5.1 #20
Workflow file for this run
This file contains hidden or 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 package | |
on: | |
release: | |
types: [published] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repository | |
uses: actions/checkout@v4 | |
# https://stackoverflow.com/a/73639034 | |
- name: Get package.json content | |
run: | | |
echo "PACKAGE_JSON=$(jq -c . < package.json)" >>$GITHUB_ENV | |
- name: Check version | |
run: | | |
[[ "${{github.ref_name}}" && "${{ github.ref_name }}" == *"${{ fromJson(env.PACKAGE_JSON).version }}"* ]] | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'npm' | |
- name: Install vsce | |
run: npm install '@vscode/vsce' --save-dev | |
- name: Publish package | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
run: npm run deploy | |