Skip to content

Commit 2d27aaa

Browse files
authored
ci: publish extension to Open VSX (#587)
1 parent 3458a04 commit 2d27aaa

2 files changed

Lines changed: 33 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,22 @@ jobs:
424424
--packagePath "${{ steps.download_vsix.outputs.vsix_file }}" \
425425
--pat "$VSCE_PAT"
426426
427+
- name: Publish to Open VSX Registry
428+
id: publish_open_vsx
429+
env:
430+
OPEN_VSX_TOKEN: ${{ secrets.OPEN_VSX_TOKEN }}
431+
run: |
432+
if [ -z "$OPEN_VSX_TOKEN" ]; then
433+
echo "❌ OPEN_VSX_TOKEN secret is not configured."
434+
echo " Create a token at https://open-vsx.org/user-settings/tokens"
435+
exit 1
436+
fi
437+
438+
echo "Publishing ${{ steps.download_vsix.outputs.vsix_file }} to Open VSX Registry..."
439+
npx --yes ovsx publish \
440+
--packagePath "${{ steps.download_vsix.outputs.vsix_file }}" \
441+
-p "$OPEN_VSX_TOKEN"
442+
427443
- name: Publish Summary
428444
if: always()
429445
run: |
@@ -442,6 +458,18 @@ jobs:
442458
echo "Ensure the \`VSCE_PAT\` secret is configured with a valid Azure DevOps PAT"
443459
echo "with the \`Marketplace (Publish)\` scope for all accessible organizations."
444460
fi
461+
echo ""
462+
echo "# 🌐 Open VSX Registry"
463+
echo ""
464+
if [ "${{ steps.publish_open_vsx.outcome }}" == "success" ]; then
465+
echo "✅ Extension v${{ needs.release.outputs.version }} published to the [Open VSX Registry](https://open-vsx.org/extension/RobBos/copilot-token-tracker)"
466+
elif [ "${{ steps.publish_open_vsx.outcome }}" == "skipped" ]; then
467+
echo "⏭️ Open VSX publish skipped."
468+
else
469+
echo "❌ Failed to publish v${{ needs.release.outputs.version }} to the Open VSX Registry."
470+
echo ""
471+
echo "Ensure the \`OPEN_VSX_TOKEN\` secret is configured with a valid Open VSX token."
472+
fi
445473
} >> "$GITHUB_STEP_SUMMARY"
446474
447475
build-visualstudio:
@@ -658,4 +686,3 @@ jobs:
658686
"## ❌ Build failed — no .vsix produced" >> $env:GITHUB_STEP_SUMMARY
659687
}
660688
661-

CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ The project uses a fully automated release pipeline via GitHub Actions.
415415

416416
The workflow inputs:
417417
- `create_tag` — Creates a git tag from the `package.json` version (default: true)
418-
- `publish_marketplace` — Publishes to the VS Code Marketplace (default: true)
418+
- `publish_marketplace` — Publishes to the VS Code Marketplace and Open VSX (default: true)
419419

420420
The workflow automatically:
421421

@@ -425,13 +425,14 @@ The workflow automatically:
425425
4. Runs the full build pipeline (lint, type-check, compile, test)
426426
5. Creates a GitHub Release with the VSIX attached
427427
6. Publishes to the VS Code Marketplace (using the `VSCE_PAT` secret)
428-
7. Opens a PR to sync `CHANGELOG.md` in the repository
428+
7. Publishes to the Open VSX Registry (using the `OPEN_VSX_TOKEN` secret)
429+
8. Opens a PR to sync `CHANGELOG.md` in the repository
429430

430-
> **Security:** Only users with repository write access can trigger the `workflow_dispatch`. The `VSCE_PAT` secret must be configured in repository settings (Settings → Secrets and variables → Actions). Create a PAT at https://dev.azure.com with the "Marketplace (Publish)" scope.
431+
> **Security:** Only users with repository write access can trigger the `workflow_dispatch`. The `VSCE_PAT` secret must be configured in repository settings (Settings → Secrets and variables → Actions). Create a PAT at https://dev.azure.com with the "Marketplace (Publish)" scope. The `OPEN_VSX_TOKEN` secret must also be configured; create a token at https://open-vsx.org/user-settings/tokens.
431432
432433
### Tag-Based Release (Build Only)
433434

434-
Pushing a version tag (e.g., `git push origin v0.0.19`) triggers the build and creates a GitHub release, but does **not** publish to the marketplace. Use the workflow dispatch for the full pipeline.
435+
Pushing a version tag (e.g., `git push origin v0.0.19`) triggers the build and creates a GitHub release, but does **not** publish to the marketplaces. Use the workflow dispatch for the full pipeline.
435436

436437
### Manual Changelog Sync
437438

0 commit comments

Comments
 (0)