Add CI/CD pipeline with VSIX packaging #1
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: xvfb-run -a npm test | |
| - name: Package extension (VSIX) | |
| run: npm run package:vsix | |
| - name: Get version from tag | |
| id: get_version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: '*.vsix' | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Uncomment to publish to VS Code Marketplace | |
| # Requires VSCE_PAT secret with marketplace Personal Access Token | |
| # - name: Publish to VS Code Marketplace | |
| # run: npx vsce publish -p ${{ secrets.VSCE_PAT }} | |
| # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| # Uncomment to publish to Open VSX Registry | |
| # Requires OVSX_PAT secret with Open VSX access token | |
| # - name: Publish to Open VSX | |
| # run: npx ovsx publish -p ${{ secrets.OVSX_PAT }} | |
| # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') |