Catalog check-in #13
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
| # Publish AI Stack Kit VS Code extension to the Visual Studio Marketplace | |
| # and the Open VSX Registry (used by Cursor, VSCodium, Gitpod, etc.) on | |
| # version tags. | |
| # | |
| # Setup (one-time): | |
| # 1. Create the publisher on each registry — same name (`deb-adarsh`): | |
| # - Visual Studio Marketplace: https://marketplace.visualstudio.com/manage | |
| # - Open VSX Registry: https://open-vsx.org/user-settings/namespaces | |
| # (sign in with GitHub, create the `deb-adarsh` namespace) | |
| # 2. Generate Personal Access Tokens: | |
| # - Azure DevOps PAT for vsce -> repo secret `VSCE_PAT` | |
| # - Open VSX access token -> repo secret `OVSX_PAT` | |
| # (https://open-vsx.org/user-settings/tokens) | |
| # | |
| # Release: | |
| # 1. Bump `extension/package.json` version + update `extension/CHANGELOG.md` | |
| # 2. Commit and push to main | |
| # 3. Tag the release and push the tag: | |
| # git tag v1.3.0 && git push origin v1.3.0 | |
| # The tagged build runs tests, packages the VSIX once, then publishes the | |
| # same artifact to both registries so Cursor and VS Code stay in sync. | |
| name: Publish VS Code Extension | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Test | |
| run: npm test | |
| - name: Build VS Code extension | |
| run: npm run build:extension | |
| - name: Extension integration tests | |
| run: xvfb-run -a npm run test:extension | |
| - name: Check extension bundle size | |
| run: test $(wc -c < extension/dist/extension.js) -lt 5242880 | |
| publish: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build extension package | |
| run: npm run build:extension | |
| - name: Package VSIX artifact | |
| working-directory: extension | |
| run: npm run vsix | |
| - name: Locate VSIX | |
| id: vsix | |
| working-directory: extension | |
| run: | | |
| file=$(ls *.vsix | head -n1) | |
| if [ -z "$file" ]; then | |
| echo "No VSIX found in extension/" >&2 | |
| exit 1 | |
| fi | |
| echo "path=extension/$file" >> "$GITHUB_OUTPUT" | |
| echo "file=$file" >> "$GITHUB_OUTPUT" | |
| - name: Upload VSIX | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ai-stack-kit-vsix | |
| path: ${{ steps.vsix.outputs.path }} | |
| if-no-files-found: error | |
| - name: Publish to Visual Studio Marketplace | |
| working-directory: extension | |
| run: npx --no-install vsce publish --no-dependencies --packagePath "${{ steps.vsix.outputs.file }}" | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
| - name: Check Open VSX token | |
| id: ovsx_check | |
| env: | |
| OVSX_PAT: ${{ secrets.OVSX_PAT }} | |
| run: | | |
| if [ -n "$OVSX_PAT" ]; then | |
| echo "have_token=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "have_token=false" >> "$GITHUB_OUTPUT" | |
| echo "::warning::Skipping Open VSX publish — set repo secret OVSX_PAT to enable Cursor / VSCodium distribution." | |
| fi | |
| - name: Publish to Open VSX (Cursor / VSCodium) | |
| if: steps.ovsx_check.outputs.have_token == 'true' | |
| working-directory: extension | |
| run: npx --no-install ovsx publish --no-dependencies --packagePath "${{ steps.vsix.outputs.file }}" | |
| env: | |
| OVSX_PAT: ${{ secrets.OVSX_PAT }} |