|
1 | 1 | name: Extension release (platform VSIXes) |
2 | 2 |
|
3 | | -# Produces a platform-specific VSIX per OS/arch with a self-contained Fuse host bundled in (so the extension |
4 | | -# runs with no global install). Manually dispatched or on an ext-v* tag. Each platform builds on its matching |
5 | | -# OS so the host publishes natively; the six VSIXes are uploaded as artifacts for a maintainer to publish. |
| 3 | +# Part of the vX.Y.Z release: the same tag that ships the .NET tool ships the VS Code extension. Builds a |
| 4 | +# platform-specific VSIX per OS/arch with a self-contained Fuse host bundled in (so the extension runs with no |
| 5 | +# global install), each on its matching OS so the host publishes natively, then publishes all six to the VS Code |
| 6 | +# Marketplace and Open VSX. Publishing is gated on the VSCE_PAT / OVSX_PAT secrets, so until those are set the |
| 7 | +# release still builds the VSIXes as artifacts. A manual dispatch builds artifacts without publishing. |
6 | 8 | on: |
7 | 9 | workflow_dispatch: |
8 | 10 | push: |
9 | | - tags: ['ext-v*'] |
| 11 | + tags: ['v*.*.*'] |
10 | 12 |
|
11 | 13 | jobs: |
| 14 | + verify: |
| 15 | + name: Verify version |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + # The codebase owns the version (see build/verify-version.ps1). On a release tag, fail unless the tag |
| 22 | + # matches package.json and the sibling packages; on manual dispatch, just check cross-package consistency. |
| 23 | + - name: Verify version |
| 24 | + shell: pwsh |
| 25 | + run: | |
| 26 | + if ("${{ github.ref_type }}" -eq "tag") { ./build/verify-version.ps1 -Tag "${{ github.ref_name }}" } |
| 27 | + else { ./build/verify-version.ps1 } |
| 28 | +
|
12 | 29 | package: |
13 | 30 | name: Package ${{ matrix.vsceTarget }} |
| 31 | + needs: verify |
14 | 32 | runs-on: ${{ matrix.os }} |
15 | 33 | strategy: |
16 | 34 | fail-fast: false |
|
70 | 88 | with: |
71 | 89 | name: fuse-vscode-${{ matrix.vsceTarget }} |
72 | 90 | path: ext/vscode/*.vsix |
| 91 | + |
| 92 | + publish: |
| 93 | + name: Publish to marketplaces |
| 94 | + needs: package |
| 95 | + runs-on: ubuntu-latest |
| 96 | + # Only publish on a release tag; a manual dispatch stops at the artifacts. Each step is further gated on its |
| 97 | + # token secret, so the job is a clean no-op until the secrets are configured. |
| 98 | + if: github.ref_type == 'tag' |
| 99 | + env: |
| 100 | + VSCE_PAT: ${{ secrets.VSCE_PAT }} |
| 101 | + OVSX_PAT: ${{ secrets.OVSX_PAT }} |
| 102 | + steps: |
| 103 | + - name: Download platform VSIXes |
| 104 | + uses: actions/download-artifact@v4 |
| 105 | + with: |
| 106 | + path: vsix |
| 107 | + pattern: fuse-vscode-* |
| 108 | + merge-multiple: true |
| 109 | + |
| 110 | + - name: Setup Node |
| 111 | + uses: actions/setup-node@v4 |
| 112 | + with: |
| 113 | + node-version: '20' |
| 114 | + |
| 115 | + # All six platform VSIXes carry the same version and distinct targets, so one publish uploads them as the |
| 116 | + # platform variants of one Marketplace version. |
| 117 | + - name: Publish to VS Code Marketplace |
| 118 | + if: env.VSCE_PAT != '' |
| 119 | + run: npx --yes @vscode/vsce publish --pat "$VSCE_PAT" --packagePath vsix/*.vsix |
| 120 | + |
| 121 | + - name: Publish to Open VSX |
| 122 | + if: env.OVSX_PAT != '' |
| 123 | + run: | |
| 124 | + for f in vsix/*.vsix; do npx --yes ovsx publish "$f" -p "$OVSX_PAT"; done |
| 125 | +
|
| 126 | + - name: Report skipped publish |
| 127 | + if: env.VSCE_PAT == '' && env.OVSX_PAT == '' |
| 128 | + run: echo "::notice::No VSCE_PAT or OVSX_PAT secret configured; the six VSIXes were built as artifacts but not published." |
0 commit comments