Context
We want the ability to publish pre-release versions of the VS Code extension alongside regular releases, using the VS Code Marketplace's built-in pre-release channel. This gives users an opt-in "Switch to Pre-Release Version" button in the marketplace UI.
How VS Code Marketplace pre-releases work
Documentation: VS Code Pre-release Extensions
- Publishing: Pass
--pre-release to vsce package and vsce publish
- Version format: Only
major.minor.patch — semver pre-release tags like -beta.1 are not supported (vsce PR #666, vsmarketplace#310)
- User experience: Users opt in via the marketplace UI; a "Switch to Pre-Release Version" button appears on the extension page
- Open VSX: Also supports
--pre-release (openvsx#386, openvsx PR #410)
Auto-update behavior (key docs quotes)
From VS Code docs:
"VS Code will automatically update extensions to the highest version available, so even if a user opted-into a pre-release version and there is an extension release with a higher version, the user will be updated to the released version."
"Note that while pre-release users will be updated to a release version if it is higher, they still remain eligible to automatically update to future pre-releases with higher version numbers than the release version."
This means:
- Pre-release users always get the highest version — whether it's a pre-release or a release
- Release users only get non-pre-release versions
- When a release is published with a higher version than the current pre-release, pre-release users get it too — but they stay opted-in to the pre-release channel and will receive the next pre-release
Proposed scheme: simple checkbox, no special versioning
We don't need the even/odd minor versioning that VS Code recommends. We can just keep incrementing versions monotonically, and use the checkbox to decide whether each publish is a pre-release or a release:
| Version |
Checkbox |
Release users see |
Pre-release users see |
| 8.7.0 |
release |
8.7.0 |
8.7.0 |
| 8.8.0 |
pre-release |
stay on 8.7.0 |
8.8.0 |
| 8.9.0 |
release |
8.9.0 |
8.9.0 (higher than 8.8.0) |
| 8.10.0 |
pre-release |
stay on 8.9.0 |
8.10.0 |
Pre-release users get everything — they see every version we publish. Release users only see the ones we explicitly publish as releases. No special version numbering scheme required.
The only constraint from the docs:
"Versions must be different between pre-release and regular releases. That is, if 1.2.3 is uploaded as a pre-release, the next regular release must be uploaded with a distinct version, such as 1.2.4."
This is naturally satisfied since our versions always increment.
Current state
publish.yml has two inputs: bump (patch/minor/major) and version (override). No pre-release option.
packages/kilo-vscode/script/build.ts runs vsce package without --pre-release
packages/kilo-vscode/script/publish.ts runs vsce publish --packagePath and ovsx publish --packagePath without --pre-release
- The
script/release convenience wrapper dispatches publish.yml with a bump type
Implementation plan
1. Add pre_release checkbox to publish.yml
workflow_dispatch:
inputs:
bump:
description: "Bump major, minor, or patch"
required: false
type: choice
options:
- patch
- minor
- major
version:
description: "Override version (optional)"
required: false
type: string
pre_release:
description: "Publish as pre-release (VS Code marketplace)"
required: false
type: boolean
default: false
Pass it through as KILO_PRE_RELEASE env var to the build-vscode and publish jobs.
2. Update packages/kilo-vscode/script/build.ts
When KILO_PRE_RELEASE=true, add --pre-release to the vsce package command:
const args = ["--no-dependencies", "--skip-license", "--target", config.target, "-o", vsixPath]
if (process.env.KILO_PRE_RELEASE === "true") args.push("--pre-release")
await $`vsce package ${args}`
3. Update packages/kilo-vscode/script/publish.ts
When KILO_PRE_RELEASE=true, add --pre-release to both vsce publish and ovsx publish:
const pre = process.env.KILO_PRE_RELEASE === "true"
const preArgs = pre ? ["--pre-release"] : []
await $`vsce publish ${preArgs} --packagePath ${vsixPath}`
await $`npx ovsx publish ${preArgs} --pat ${process.env.OPENVSX_TOKEN} --packagePath ${vsixPath}`
4. Update script/release
Add a --pre-release flag option:
#!/usr/bin/env bash
BUMP_TYPE=${1:-patch}
PRE_RELEASE=${2:-false}
gh workflow run publish.yml -f bump="$BUMP_TYPE" -f pre_release="$PRE_RELEASE"
Files to modify
| File |
Change |
.github/workflows/publish.yml |
Add pre_release boolean input, pass as env var to build-vscode + publish jobs |
packages/kilo-vscode/script/build.ts |
Conditionally add --pre-release to vsce package |
packages/kilo-vscode/script/publish.ts |
Conditionally add --pre-release to vsce publish and ovsx publish |
script/release |
Accept and forward pre-release flag |
References
Context
We want the ability to publish pre-release versions of the VS Code extension alongside regular releases, using the VS Code Marketplace's built-in pre-release channel. This gives users an opt-in "Switch to Pre-Release Version" button in the marketplace UI.
How VS Code Marketplace pre-releases work
Documentation: VS Code Pre-release Extensions
--pre-releasetovsce packageandvsce publishmajor.minor.patch— semver pre-release tags like-beta.1are not supported (vsce PR #666, vsmarketplace#310)--pre-release(openvsx#386, openvsx PR #410)Auto-update behavior (key docs quotes)
From VS Code docs:
This means:
Proposed scheme: simple checkbox, no special versioning
We don't need the even/odd minor versioning that VS Code recommends. We can just keep incrementing versions monotonically, and use the checkbox to decide whether each publish is a pre-release or a release:
Pre-release users get everything — they see every version we publish. Release users only see the ones we explicitly publish as releases. No special version numbering scheme required.
The only constraint from the docs:
This is naturally satisfied since our versions always increment.
Current state
publish.ymlhas two inputs:bump(patch/minor/major) andversion(override). No pre-release option.packages/kilo-vscode/script/build.tsrunsvsce packagewithout--pre-releasepackages/kilo-vscode/script/publish.tsrunsvsce publish --packagePathandovsx publish --packagePathwithout--pre-releasescript/releaseconvenience wrapper dispatchespublish.ymlwith a bump typeImplementation plan
1. Add
pre_releasecheckbox topublish.ymlPass it through as
KILO_PRE_RELEASEenv var to thebuild-vscodeandpublishjobs.2. Update
packages/kilo-vscode/script/build.tsWhen
KILO_PRE_RELEASE=true, add--pre-releaseto thevsce packagecommand:3. Update
packages/kilo-vscode/script/publish.tsWhen
KILO_PRE_RELEASE=true, add--pre-releaseto bothvsce publishandovsx publish:4. Update
script/releaseAdd a
--pre-releaseflag option:Files to modify
.github/workflows/publish.ymlpre_releaseboolean input, pass as env var to build-vscode + publish jobspackages/kilo-vscode/script/build.ts--pre-releasetovsce packagepackages/kilo-vscode/script/publish.ts--pre-releasetovsce publishandovsx publishscript/releaseReferences