A CI for publishing open-source VS Code extensions to https://open-vsx.org
ovsx
CLI instead of adding it here.
To automatically publish an extension to Open VSX, simply add it to extensions.json
.
You can also run node add-extension [REPOSITORY]
to add it automatically.
Here is the expected format of an extensions.json
entry:
{
// Unique Open VSX extension ID in the form "<namespace>.<name>"
"id": "redhat.vscode-yaml",
// Repository URL to clone and publish from
"repository": "https://github.com/redhat-developer/vscode-yaml"
},
Here are all the supported values, including optional ones:
{
// Unique Open VSX extension ID in the form "<namespace>.<name>"
"id": "rebornix.ruby",
// Repository URL to clone and publish from
"repository": "https://github.com/rubyide/vscode-ruby",
// (RECOMMENDED) The version that should be published; the script compares this version with the latest published version
"version": "0.27.0",
// (RECOMMENDED) The Git branch, tag, or commit to check out before publishing (defaults to the repository's default branch)
"checkout": "v0.27.0",
// (OPTIONAL) Location of the extension's package.json in the repository (defaults to the repository's root directory)
"location": "packages/vscode-ruby-client",
// (OPTIONAL) Extra commands to run just before publishing to Open VSX (i.e. after "yarn/npm install", but before "vscode:prepublish")
"prepublish": "npm run build",
// (OPTIONAL) Relative path of the extension vsix file inside the git repo (i.e. when it is built by prepublish commands
"extensionFile": "dist/js-debug.vsix"
},
In cases where it is not feasible to build the extension from source, a download URL can be given instead:
{
// Unique Open VSX extension ID in the form "<namespace>.<name>"
"id": "rebornix.ruby",
// A full URL from which to download the extension package
"download": "https://github.com/rubyide/vscode-ruby/releases/download/v0.25.0/ruby-0.25.0.vsix",
// (RECOMMENDED) The version that should be published; the script compares this version with the latest published version
"version": "0.25.0"
},
Every night at 03:03 UTC, a GitHub workflow goes through all entries in extensions.json
, and checks if the specified "version"
needs to be published to https://open-vsx.org or not.
The publishing process can be summarized like this:
git clone "repository"
- (
git checkout "checkout"
if a"checkout"
value is specified) npm install
(oryarn install
if ayarn.lock
file is detected in the repository)- (
"prepublish"
) - (
ovsx create-namespace "publisher"
if it doesn't already exist) ovsx publish
(with--yarn
if ayarn.lock
file was detected earlier)
See all ovsx
CLI options here.