ci: Update version number to 0.0.0 for auto-versioning support #42
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
| on: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: | |
| - "**" | |
| workflow_dispatch: | |
| jobs: | |
| package: | |
| name: Package & Publish Extension | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3.5.3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3.7.0 | |
| with: | |
| node-version: 20.5.1 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Install vsce | |
| run: npm install --global @vscode/vsce | |
| - name: Build & package extension | |
| run: ./package.sh | |
| - name: Upload build artifacts | |
| if: github.event_name != 'pull_request' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vsix | |
| path: dist/*.vsix | |
| - name: Sync version from tag | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/v} | |
| npm version "$TAG" --no-git-tag-version | |
| # Publish to VS Code Marketplace. | |
| - name: Publish to VS Code Marketplace | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
| run: | | |
| vsce publish --pat "$VSCE_PAT" | |
| # Create GitHub Release. | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| prerelease: ${{ contains(github.ref, '-rc') }} | |
| generate_release_notes: true | |
| files: | | |
| dist/*.vsix | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |