Publish to VS Code Marketplace #1
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 allows manual publishing to VS Code Marketplace | |
| name: Publish to VS Code Marketplace | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| bump_version: | |
| description: 'Bump version before publish (patch/minor/major), leave empty to use current version' | |
| required: false | |
| type: choice | |
| options: | |
| - '' | |
| - patch | |
| - minor | |
| - major | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Configure Git | |
| if: ${{ inputs.bump_version != '' }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Bump version | |
| if: ${{ inputs.bump_version != '' }} | |
| run: | | |
| npm version ${{ inputs.bump_version }} -m "chore: bump version to %s" | |
| git push | |
| git push --tags | |
| - name: Compile | |
| run: npm run compile | |
| - name: Publish to VS Code Marketplace | |
| run: npx @vscode/vsce publish | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} |