ci: Add Terragrunt-style Go binary release workflow (#99) #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 | |
| permissions: | |
| contents: write | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: ['v*'] | |
| jobs: | |
| build: | |
| name: Package (${{ matrix.vsce_target }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - vsce_target: linux-x64 | |
| goos: linux | |
| goarch: amd64 | |
| - vsce_target: linux-arm64 | |
| goos: linux | |
| goarch: arm64 | |
| - vsce_target: darwin-x64 | |
| goos: darwin | |
| goarch: amd64 | |
| - vsce_target: darwin-arm64 | |
| goos: darwin | |
| goarch: arm64 | |
| - vsce_target: win32-x64 | |
| goos: windows | |
| goarch: amd64 | |
| - vsce_target: win32-arm64 | |
| goos: windows | |
| goarch: arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up mise | |
| uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2 | |
| with: | |
| version: 2025.6.8 | |
| - name: Install npm dependencies | |
| run: npm ci | |
| working-directory: vscode-extension | |
| - name: Package VSIX | |
| run: npx @vscode/vsce package --target ${{ matrix.vsce_target }} | |
| working-directory: vscode-extension | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| - name: Upload VSIX to GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: gh release upload "$GITHUB_REF_NAME" vscode-extension/*.vsix | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload VSIX as artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ matrix.vsce_target }} | |
| path: vscode-extension/*.vsix | |
| publish-marketplace: | |
| name: Publish to VS Code Marketplace | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up mise | |
| uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2 | |
| with: | |
| version: 2025.6.8 | |
| - name: Download all VSIX artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| - name: Publish to Marketplace | |
| run: npx @vscode/vsce publish --packagePath $(find . -iname '*.vsix') | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} |