|
| 1 | +name: VS Code Extension Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'vscode/v*' |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + release: |
| 13 | + name: Package and Publish VS Code Extension |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Setup Node.js |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: '24' |
| 24 | + |
| 25 | + - name: Setup pnpm |
| 26 | + uses: pnpm/action-setup@v4 |
| 27 | + with: |
| 28 | + version: 10 |
| 29 | + run_install: false |
| 30 | + |
| 31 | + - name: Get pnpm store directory |
| 32 | + shell: bash |
| 33 | + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
| 34 | + |
| 35 | + - name: Cache pnpm store |
| 36 | + uses: actions/cache@v4 |
| 37 | + with: |
| 38 | + path: ${{ env.STORE_PATH }} |
| 39 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('frontend/vscode-extension/pnpm-lock.yaml') }} |
| 40 | + restore-keys: | |
| 41 | + ${{ runner.os }}-pnpm-store- |
| 42 | +
|
| 43 | + - name: Install dependencies |
| 44 | + working-directory: frontend/vscode-extension |
| 45 | + run: pnpm install --frozen-lockfile |
| 46 | + |
| 47 | + - name: Build VS Code extension |
| 48 | + working-directory: frontend/vscode-extension |
| 49 | + run: pnpm build:prod |
| 50 | + |
| 51 | + - name: Extract version from tag |
| 52 | + id: version |
| 53 | + run: echo "VERSION=${GITHUB_REF_NAME#vscode/v}" >> $GITHUB_OUTPUT |
| 54 | + |
| 55 | + - name: Package extension |
| 56 | + working-directory: frontend/vscode-extension |
| 57 | + run: pnpm package --out hatchet-${{ steps.version.outputs.VERSION }}.vsix |
| 58 | + |
| 59 | + - name: Publish to VS Code Marketplace |
| 60 | + working-directory: frontend/vscode-extension |
| 61 | + env: |
| 62 | + VSCE_PAT: ${{ secrets.VSCE_PAT }} |
| 63 | + run: pnpm run publish |
| 64 | + |
| 65 | + - name: Upload .vsix as release artifact |
| 66 | + uses: softprops/action-gh-release@v2 |
| 67 | + with: |
| 68 | + files: frontend/vscode-extension/hatchet-${{ steps.version.outputs.VERSION }}.vsix |
| 69 | + name: Hatchet VS Code Extension v${{ steps.version.outputs.VERSION }} |
| 70 | + body: | |
| 71 | + ## Hatchet VS Code Extension v${{ steps.version.outputs.VERSION }} |
| 72 | +
|
| 73 | + ### Installation |
| 74 | + **From VS Code Marketplace:** Search for "Hatchet" in the Extensions panel. |
| 75 | +
|
| 76 | + **Manual install:** |
| 77 | + ``` |
| 78 | + code --install-extension hatchet-${{ steps.version.outputs.VERSION }}.vsix |
| 79 | + ``` |
| 80 | +
|
| 81 | + ### Usage |
| 82 | + Open any TypeScript file that declares a Hatchet workflow — a |
| 83 | + "$(graph) Show Hatchet DAG" CodeLens will appear above each |
| 84 | + `hatchet.workflow(...)` declaration. |
0 commit comments