Skip to content

Commit da513d6

Browse files
committed
ci: publish the VS Code extension from the release workflow
1 parent 1eab873 commit da513d6

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,79 @@ jobs:
130130
env:
131131
CHANGESETS_PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
132132

133+
# The VS Code extension is a private workspace package: changesets bumps its
134+
# version but never publishes it to npm, so it ships from here instead. Both
135+
# publish scripts skip packages that already exist in the registry, so this
136+
# job is a no-op on releases that did not touch the extension.
137+
publish-vscode-extension:
138+
timeout-minutes: 45
139+
name: Publish VS Code extension
140+
needs: release
141+
if: needs.release.outputs.packages_published == 'true'
142+
runs-on: ubuntu-latest
143+
steps:
144+
- name: Checkout
145+
uses: actions/checkout@v6
146+
147+
- name: Setup pnpm
148+
uses: pnpm/action-setup@v6
149+
150+
- name: Setup Node.js
151+
uses: actions/setup-node@v6
152+
with:
153+
node-version-file: .nvmrc
154+
cache: "pnpm"
155+
156+
- name: Install dependencies
157+
run: pnpm install --frozen-lockfile
158+
159+
- name: Generate Pythinker Code built-in catalog
160+
shell: bash
161+
run: |
162+
CATALOG_FILE="$RUNNER_TEMP/pythinker-code-built-in-catalog.json"
163+
node apps/pythinker-code/scripts/update-catalog.mjs --out "$CATALOG_FILE"
164+
echo "PYTHINKER_CODE_BUILT_IN_CATALOG_FILE=$CATALOG_FILE" >> "$GITHUB_ENV"
165+
166+
- name: Build workspace packages
167+
run: pnpm build
168+
169+
# Packages all six platform targets and runs the VSIX audit on each one.
170+
# A failure here must stop the job before anything reaches a registry.
171+
- name: Package and verify VSIX targets
172+
run: pnpm --filter pythinker-code run package:platform
173+
174+
- name: Publish to the Visual Studio Marketplace
175+
env:
176+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
177+
run: |
178+
if [ -z "$VSCE_PAT" ]; then
179+
echo "::error::VSCE_PAT secret not set — cannot publish the extension."
180+
exit 1
181+
fi
182+
pnpm --filter pythinker-code run publish:vsix
183+
184+
# Open VSX serves Cursor / VSCodium / Windsurf. A failure here must not
185+
# undo an already-successful Marketplace publish, so it only warns.
186+
- name: Publish to Open VSX
187+
continue-on-error: true
188+
env:
189+
OVSX_PAT: ${{ secrets.OVSX_PAT }}
190+
run: |
191+
if [ -z "$OVSX_PAT" ]; then
192+
echo "::warning::OVSX_PAT secret not set — skipping Open VSX publish."
193+
exit 0
194+
fi
195+
pnpm --filter pythinker-code run publish:ovsx
196+
197+
- name: Upload VSIX artifacts
198+
if: always()
199+
uses: actions/upload-artifact@v7
200+
with:
201+
name: pythinker-code-vsix
202+
path: apps/vscode/artifacts/vsix/*.vsix
203+
retention-days: 7
204+
if-no-files-found: error
205+
133206
# code.pythinker.com redeploys via Dokploy autodeploy on push to main
134207
# (app Pythinker/code builds apps/site/Dockerfile from the repo, no npm
135208
# registry dependency), so no deploy webhook is fired here — this job only

0 commit comments

Comments
 (0)