From 473ec1dbc5eef0cda731bb2fcb985c59f367161c Mon Sep 17 00:00:00 2001 From: Kayshen-X Date: Sun, 19 Jul 2026 20:45:02 +0800 Subject: [PATCH] ci(vscode): publish platform vsix to open-vsx on release --- .github/workflows/rust-release.yml | 20 ++++++++++++++++++++ packages/op-vscode/package.json | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index f1b41babd..32abeb21c 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -759,6 +759,26 @@ jobs: name: openpencil-vscode-vsix path: packages/op-vscode/*.vsix if-no-files-found: error + # Open VSX is the registry Cursor / VSCodium / Gitpod pull from. The + # token comes from https://open-vsx.org/user-settings/tokens (an + # account owning the `openpencil` namespace) stored as the + # OPENVSX_TOKEN repo secret — mirrors the NPM_TOKEN hard-requirement. + - name: Publish to Open VSX + working-directory: packages/op-vscode + env: + OPENVSX_TOKEN: ${{ secrets.OPENVSX_TOKEN }} + shell: bash + run: | + set -euo pipefail + if [ -z "${OPENVSX_TOKEN:-}" ]; then + echo "::error::OPENVSX_TOKEN is required to publish to open-vsx.org (create it at https://open-vsx.org/user-settings/tokens, add as repo secret)" + exit 1 + fi + # First-run namespace claim; harmless "already exists" afterwards. + bunx ovsx create-namespace openpencil -p "$OPENVSX_TOKEN" || true + for f in ./openpencil-vscode-"${OP_VERSION}"-*.vsix; do + bunx ovsx publish --packagePath "$f" -p "$OPENVSX_TOKEN" + done release-draft: name: Create / update GitHub prerelease diff --git a/packages/op-vscode/package.json b/packages/op-vscode/package.json index 1c30ed83c..0012197bc 100644 --- a/packages/op-vscode/package.json +++ b/packages/op-vscode/package.json @@ -105,5 +105,10 @@ "esbuild": "^0.21", "jsonc-parser": "^3", "oxlint": "latest" + }, + "repository": { + "type": "git", + "url": "https://github.com/ZSeven-W/openpencil.git", + "directory": "packages/op-vscode" } }