ignore dev ts #8
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: Build and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| create_release: | |
| description: 'Create a GitHub release' | |
| required: false | |
| type: boolean | |
| default: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - 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('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Compile server | |
| run: pnpm run compile:server | |
| - name: Run type check | |
| run: pnpm run check-types | |
| - name: Run linter | |
| run: pnpm run lint | |
| - name: Build extension | |
| run: pnpm run package | |
| - name: Install vsce | |
| run: pnpm add -g @vscode/vsce | |
| - name: Package extension | |
| run: | | |
| mkdir -p releases | |
| vsce package --no-dependencies -o releases/ | |
| - name: Get extension info | |
| id: ext_info | |
| run: | | |
| VSIX_FILE=$(ls releases/*.vsix) | |
| echo "vsix_path=$VSIX_FILE" >> $GITHUB_OUTPUT | |
| echo "vsix_name=$(basename $VSIX_FILE)" >> $GITHUB_OUTPUT | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Upload VSIX artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vsix-package | |
| path: releases/*.vsix | |
| retention-days: 30 | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.create_release) | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.ext_info.outputs.version }} | |
| name: v${{ steps.ext_info.outputs.version }} | |
| files: ${{ steps.ext_info.outputs.vsix_path }} | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |