chore: bump vscode extension version to 0.1.14 #74
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: VSCode Extension | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "vscode-extension/**" | |
| - ".github/workflows/vscode-extension.yml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "vscode-extension/**" | |
| - ".github/workflows/vscode-extension.yml" | |
| workflow_dispatch: | |
| inputs: | |
| publish: | |
| description: "Publish to marketplaces" | |
| required: false | |
| default: false | |
| type: boolean | |
| defaults: | |
| run: | |
| working-directory: vscode-extension | |
| jobs: | |
| build: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('vscode-extension/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Lint | |
| run: pnpm run lint | |
| - name: Compile | |
| run: pnpm run compile | |
| - name: Package extension | |
| run: pnpm run package | |
| - name: Upload VSIX artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gpu-go-vsix | |
| path: vscode-extension/*.vsix | |
| retention-days: 30 | |
| # Test on multiple VS Code versions | |
| test: | |
| name: Test on VS Code ${{ matrix.vscode-version }} | |
| needs: build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| vscode-version: ["stable", "insiders"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('vscode-extension/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run tests | |
| uses: coactions/setup-xvfb@v1 | |
| with: | |
| run: pnpm test | |
| working-directory: vscode-extension | |
| env: | |
| VSCODE_VERSION: ${{ matrix.vscode-version }} | |
| # Publish to VS Marketplace and Open VSX | |
| publish: | |
| name: Publish Extension | |
| needs: [build, test] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: | | |
| (github.event_name == 'push' && github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'chore(release): vscode-extension')) || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('vscode-extension/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Get version | |
| id: version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Package extension | |
| run: pnpm run package | |
| - name: Publish to VS Marketplace | |
| run: pnpm exec vsce publish --no-dependencies -p ${{ secrets.VSCE_PAT }} | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
| - name: Publish to Open VSX (for Cursor, VSCodium, etc.) | |
| run: pnpm exec ovsx publish --no-dependencies -p ${{ secrets.OVSX_PAT }} | |
| env: | |
| OVSX_PAT: ${{ secrets.OVSX_PAT }} | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: vscode-extension-v${{ steps.version.outputs.version }} | |
| name: VS Code Extension v${{ steps.version.outputs.version }} | |
| body: | | |
| ## GPUGo VS Code Extension v${{ steps.version.outputs.version }} | |
| ### Installation | |
| - **VS Code Marketplace**: [gpu-go](https://marketplace.visualstudio.com/items?itemName=nexusgpu.gpu-go) | |
| - **Open VSX**: [gpu-go](https://open-vsx.org/extension/tensor-fusion/gpu-go) | |
| Or install directly in VS Code: | |
| ``` | |
| ext install nexusgpu.gpu-go | |
| ``` | |
| files: | | |
| vscode-extension/*.vsix | |
| # Pre-release publishing for development branches | |
| publish-prerelease: | |
| name: Publish Pre-release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.ref != 'refs/heads/main' && contains(github.event.head_commit.message, '[prerelease]') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('vscode-extension/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Bump version for pre-release | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| PRERELEASE_VERSION="${VERSION}-dev.$(date +%Y%m%d%H%M%S)" | |
| pnpm version $PRERELEASE_VERSION --no-git-tag-version | |
| - name: Package extension | |
| run: pnpm run package -- --pre-release | |
| - name: Publish pre-release to VS Marketplace | |
| run: pnpm exec vsce publish --pre-release -p ${{ secrets.VSCE_PAT }} | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
| - name: Publish pre-release to Open VSX (for Cursor, VSCodium, etc.) | |
| run: pnpm exec ovsx publish --pre-release -p ${{ secrets.OVSX_PAT }} | |
| env: | |
| OVSX_PAT: ${{ secrets.OVSX_PAT }} |