VSCode Extension Release Automation
Automated release system for the VSCode extension
VSCode Extension Release Automation
This document outlines the automated release system for the VSCode extension (apps/vscode-extension
) that enables seamless publishing to both the Visual Studio Marketplace and Open VSX Registry.
Implementation Overview
The automation consists of two main components:
1. GitHub Workflow
The workflow is defined in .github/workflows/vscode-extension-release.yml
:
Triggers:
- Automatically after the “Changeset NPM Release” workflow completes
- Manual dispatch for testing/emergency releases
Conditions:
- Only runs when the commit message contains “chore: version packages” (indicating a version bump)
- Only runs when the VSCode extension’s
package.json
version was actually changed
Process:
- Version Check: Validates that this is a version bump commit and that the VSCode extension version specifically changed
- Release: Builds, packages, publishes to both marketplaces, and creates GitHub release
2. Composite Action
The composite action is located at tooling/github/vscode-extension/github-release/action.yml
:
Steps:
- Setup Environment: Uses the shared setup action
- Build Extension: Runs
bun run build
to compile the extension - Package Extension: Creates VSIX file using
bunx vsce package
- Publish to Visual Studio Marketplace: Publishes using
bunx vsce publish
- Publish to Open VSX Registry: Publishes using
bunx ovsx publish
- Extract Changelog: Reads version-specific changes from
CHANGELOG.md
- Create GitHub Release: Creates release with tag
vscode-v{version}
and attaches VSIX file
Setup Requirements
Required GitHub Secrets
Add the following secrets to your GitHub repository:
-
VSCE_PAT
: Personal Access Token for Visual Studio Marketplace- Generate at: https://dev.azure.com/
- Requires “Marketplace (publish)” scope
- Should be associated with the publisher account (“unhook”)
-
OVSX_PAT
: Personal Access Token for Open VSX Registry- Generate at: https://open-vsx.org/user-settings/tokens
- Requires publishing permissions
- Should be associated with your Open VSX account
Open VSX Registry Setup
Before publishing to Open VSX, you need to:
- Create an Eclipse account at eclipse.org (use same GitHub account as open-vsx.org)
- Sign the Publisher Agreement at open-vsx.org
- Create an access token in your Open VSX settings
- Namespace creation is handled automatically by the workflow
The automation will automatically create the namespace (publisher) if it doesn’t exist during the first publish.
VSCode Extension Configuration
The automation expects:
- Extension built with Bun (already configured)
- Extension publisher set to “unhook” in
package.json
(already set) - Changelog maintained in
apps/vscode-extension/CHANGELOG.md
with version sections like:
Workflow Integration
Automatic Process
- Version Bump PR: Changesets workflow creates PR with version bumps
- PR Merge: When PR is merged to
main
, Changeset NPM Release workflow runs - VSCode Release: If VSCode extension version changed, the VSCode Extension Release workflow automatically triggers
- Dual Marketplace Publication: Extension is built, packaged, and published to both Visual Studio Marketplace and Open VSX Registry
- GitHub Release: Release created with VSIX file attachment
Manual Fallback
If automation fails, manual release steps:
Marketplace Coverage
Publishing to both marketplaces ensures broad compatibility:
- Visual Studio Marketplace: Used by Microsoft VS Code
- Open VSX Registry: Used by VS Code alternatives like:
- VSCodium
- Gitpod
- Eclipse Theia
- Code-OSS distributions
Monitoring
The workflow provides clear logging for each step:
- Build status and output
- Package creation
- Visual Studio Marketplace publishing result
- Open VSX Registry publishing result
- GitHub release creation
Failed steps will be clearly indicated in the GitHub Actions logs.
Security Considerations
- Both
VSCE_PAT
andOVSX_PAT
are securely stored as GitHub secrets - Tokens have minimal required permissions (marketplace publish only)
- Extension files are built from source during workflow execution
- All steps logged for audit trail
File Structure
The workflow only triggers when the VSCode extension version specifically changes. GitHub releases use the tag format vscode-v{version}
to distinguish from CLI releases.
Best Practices
- VSIX files are automatically attached to GitHub releases for manual distribution
- The automation follows the same patterns as the existing CLI release workflow for consistency
- Version management is handled by the Changesets workflow - no manual version bumping required
- Dual marketplace publishing ensures maximum compatibility across VS Code distributions