fix VS Code release #3
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 VS Code Extension | |
| on: | |
| push: | |
| tags: | |
| - "vscode-v*" # VS Code extension-specific version tags | |
| workflow_dispatch: | |
| jobs: | |
| release_vscode: | |
| name: Publish VS Code Extension | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Wait for required checks | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const script = require('./.github/wait-for-checks.js'); | |
| await script({ github, context, core }); | |
| - name: Download TypeScript bindings from CI | |
| uses: dawidd6/action-download-artifact@v2 | |
| with: | |
| workflow: ci.yml | |
| workflow_conclusion: success | |
| name: typescript-bindings | |
| path: ${{ github.workspace }}/renamify-core/bindings | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| working-directory: renamify-vscode | |
| run: pnpm install | |
| - name: Verify version | |
| id: version | |
| run: | | |
| # Extract version from package.json | |
| VERSION=$(node -p "require('./renamify-vscode/package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| if [ "${{ github.event_name }}" = "push" ]; then | |
| # Verify tag matches package.json version | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| EXPECTED_TAG="vscode-v$VERSION" | |
| if [ "$TAG" != "$EXPECTED_TAG" ]; then | |
| echo "Error: Tag $TAG doesn't match expected $EXPECTED_TAG from package.json" | |
| exit 1 | |
| fi | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| else | |
| # Workflow dispatch - create tag from package.json version | |
| echo "tag=vscode-v$VERSION" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Package extension | |
| working-directory: renamify-vscode | |
| run: pnpm run package | |
| - name: Publish to VS Code Marketplace | |
| working-directory: renamify-vscode | |
| run: npx vsce publish --no-dependencies --packagePath *.vsix -p ${{ secrets.VSCE_TOKEN }} | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| if: github.event_name == 'push' | |
| with: | |
| tag_name: vscode-v${{ steps.version.outputs.version }} | |
| name: VS Code Extension v${{ steps.version.outputs.version }} | |
| files: renamify-vscode/*.vsix | |
| body: | | |
| ## Renamify VS Code Extension v${{ steps.version.outputs.version }} | |
| Install from VS Code Marketplace or download the VSIX file below. | |
| ### Installation | |
| - Open VS Code | |
| - Go to Extensions (Ctrl+Shift+X) | |
| - Search for "Renamify" | |
| - Click Install | |
| Or install the VSIX manually: | |
| ```bash | |
| code --install-extension renamify-*.vsix | |
| ``` | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |