Bump version to 2.3.4-1 #56
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: VS Code Extension CI | |
| on: | |
| push: | |
| branches: [main, master, development] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| jobs: | |
| build_and_test: | |
| name: Build, Lint and Package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Lint | |
| run: yarn lint | |
| - name: Format check | |
| run: yarn format:check | |
| - name: Compile (tsc) | |
| run: yarn compile | |
| - name: Build (webpack) | |
| run: yarn webpack | |
| - name: Install Xvfb | |
| run: sudo apt-get update && sudo apt-get install -y xvfb | |
| - name: Run tests (if present) | |
| shell: bash | |
| env: | |
| VSCODE_TEST: "1" | |
| ELECTRON_ENABLE_STACK_DUMPING: "1" | |
| ELECTRON_NO_ATTACH_CONSOLE: "1" | |
| run: | | |
| if [ -f ./out/test/runTest.js ]; then | |
| echo "Running VS Code tests under Xvfb..." | |
| xvfb-run -a --server-args="-screen 0 1280x1024x24" env VSCODE_TEST=1 yarn test | |
| else | |
| echo "No VS Code tests found. Skipping." | |
| fi | |
| - name: Package VSIX | |
| run: npx --yes @vscode/vsce package | |
| - name: Upload VSIX artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vsix | |
| path: '*.vsix' | |
| publish: | |
| name: Publish Extension | |
| needs: build_and_test | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| runs-on: ubuntu-latest | |
| env: | |
| VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }} | |
| OVSX_TOKEN: ${{ secrets.OVSX_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Build (webpack) | |
| run: yarn webpack | |
| - name: Verify tag commit is on master | |
| id: verify_master | |
| run: | | |
| git fetch origin master | |
| if git merge-base --is-ancestor "$GITHUB_SHA" origin/master; then | |
| echo "on_master=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "on_master=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Publish to Visual Studio Marketplace (vsce) | |
| if: ${{ env.VSCE_TOKEN != '' && steps.verify_master.outputs.on_master == 'true' }} | |
| run: npx --yes @vscode/vsce publish -p "$VSCE_TOKEN" | |
| - name: Publish to Open VSX (ovsx) | |
| if: ${{ env.OVSX_TOKEN != '' && steps.verify_master.outputs.on_master == 'true' }} | |
| run: npx --yes ovsx publish -p "$OVSX_TOKEN" | |
| # Notes: | |
| # - Set repository secrets VSCE_TOKEN (for Visual Studio Marketplace) and OVSX_TOKEN (for Open VSX) | |
| # to enable publishing. If secrets are not set, the publish steps will be skipped. | |
| # - The publish job runs only on tags starting with "v" (e.g., v2.0.1). Ensure package.json version matches the tag. |