Publish to Visual Studio Code Marketplace #5
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
| # This workflow publishes the extension to the VSCode marketplace when the version changes. | |
| name: Publish to Visual Studio Code Marketplace | |
| on: [push, workflow_dispatch] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Check version changes | |
| if: github.event_name != 'workflow_dispatch' | |
| uses: EndBug/version-check@v2 | |
| id: check | |
| - name: Install dependencies | |
| if: steps.check.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' | |
| run: npm install | |
| - name: Publish | |
| if: steps.check.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' | |
| run: | | |
| npm run package | |
| npm run publish -- -p "${{ secrets.VSCODE_MARKETPLACE_TOKEN }}" |