The extension talks to Spinbox through the spin CLI alone, by a JSON contract that
src/cli/contract.ts holds as types. Every change goes in by pull request, with CI green.
Needs Go (the tools are pinned in go.mod), Node 22 and pnpm.
go tool task install # dependencies, through Socket Firewall
go tool task test # unit tests (Vitest), against the fake spin in test/fake-spin/
go tool task test:cli # the reader against the pinned release's real CLI (package:spin)
go tool task test:integration # test:cli, then the extension in a real VS Code; needs a display
go tool task ci # what CI runsF5 in VS Code runs the extension in an Extension Development Host (.vscode/launch.json).
test/fake-spin/spin.cjs answers every command and every error code of the contract, from
environment variables or a scenario file: its header says how.
Every VSIX carries the spin CLI of one spin release, the one versions.yaml pins as spin, and a
CLI speaks only to an installation of its own release; so the extension follows each spin release.
spin-stack/ship-it dispatches
.github/workflows/bump-spin.yml with each spin release newer than the pin (input release; the
run is named spin <release>, which is how ship-it finds it again). The run:
- stops, successfully, when the release is not newer than the pin (
task spin:newer); - bumps the pin (
task spin:bump, go-tools'versions bump spin <release>), reading the tag's commit from spin with a read-only token of the release app; - holds
src/cli/contract.ts's error codes and actions to errorActions in that release'scmd/cli/cmd/errcode.go(task contract:spin,hack/errcodes), with the same token: a code spin added or dropped fails the run, and the contract, the errors module and the fake spin follow it by hand; - runs
task ciandtask package:all, which pulls that release's CLI for every platform it has one for and checks each with cosign; - moves
package.json's version to the next patch when a tag has it already, commits that and the pin as the release app (spin-stack-release), force-pushesspin/next, and opens the pull request there, or rewrites the one open (task spin:propose,hack/spinpropose).
One branch, rewritten by each run: what waits there is always the newest release, and a newer one
replaces commits added to it. The pull request is opened by the app, not by the run's own token, so
CI and Package run on it. Merging it, after checking the CLI's contract against
src/cli/contract.ts and trying the extension against an installation of that release, is a
person's, and it releases the extension: .github/workflows/tag.yml tags the merge (below). With
ship-it's auto-merge on, ship-it merges it instead once every check passed, and
.github/workflows/wake.yml (task ship-it:wake) wakes ship-it each time CI or Package finishes on
spin/next. Both runs need the app's key as the secret RELEASE_APP_KEY.
To bump by hand, go tool task spin:bump RELEASE=<release>, go tool task contract:spin and
go tool task package:all.
A tag v* pushed to this repository runs .github/workflows/publish.yml. It packages every
platform once (task package:all), makes the tag's GitHub release (task publish:github),
pushes the same files to the public package ghcr.io/spin-stack/vscode-spinbox-release
(task publish:ghcr), and then publishes the same VSIXs to the Visual Studio Marketplace
(vsce). The tag is v followed by package.json's version.
Nobody pushes that tag for a release. A push to main that changes package.json runs
.github/workflows/tag.yml (task release:tag): when no tag has the version it holds, it tags
that commit v<version>, or v<version>-pre for an odd minor (the Marketplace's convention for a
pre-release), as the release app, since a tag pushed with the run's own token would start no
workflow. So merging a bump releases it, and so does merging a version set by hand. The tag workflow needs RELEASE_APP_KEY too.
The GitHub release comes first, in a job of its own, so it exists whether or not the Marketplace is set up or answers. It holds:
| File | What |
|---|---|
spinbox-<target>.vsix |
One per platform: linux-x64, linux-arm64, darwin-x64, darwin-arm64 |
spin-release.txt |
The one spin release every VSIX's CLI is (bin/<target>/VERSION) |
SHA256SUMS |
sha256sum of the VSIXs and spin-release.txt |
SHA256SUMS.sigstore.json |
cosign's keyless signature of SHA256SUMS, as publish.yml at the tag |
The same files go to a public package as well, so a spin CLI can pull them anonymously, the
way spin publishes its own CLIs (ghcr.io/spin-stack/spin-release): one OCI artifact per tag,
pushed with oras (hack/ghcrpush), each file a layer named by its file name.
Tag of ghcr.io/spin-stack/vscode-spinbox-release |
What |
|---|---|
<tag> (v0.4.0) |
The release's files, as above |
spin-<release> (spin-v20261106.01) |
The same artifact: the release last pushed whose VSIXs carry that spin release |
spin-<release>-pre |
The same, for a pre-release, so one never takes the tag a release holds |
The manifest's org.opencontainers.image.version is the extension's tag. spin vscode install,
run by a spin CLI, pulls spin-<its release> anonymously (then spin-<its release>-pre), holds
SHA256SUMS.sigstore.json to publish.yml at the tag the manifest names, the VSIX and
spin-release.txt to SHA256SUMS, and installs the VSIX into VS Code. The package is transport:
a tag moved to another artifact can only point at another release this workflow signed. By hand,
oras pull ghcr.io/spin-stack/vscode-spinbox-release:<tag>, the cosign verify-blob line the
release notes say, and then code --install-extension spinbox-<target>.vsix.
The package is made private by its first push, and nothing installs from it until someone makes it public, once: docs/publishing.md.
A tag with -pre after it (v0.3.0-pre) publishes that version as a pre-release: the Marketplace takes no semver
pre-release versions, and its convention is an odd minor for pre-releases.
git tag v0.3.0-pre && git push origin v0.3.0-pre # package.json says "version": "0.3.0"The Marketplace trusts the workflow by OIDC in the GitHub environment publish, so it keeps no
token. A run that failed halfway is run again whole: the Marketplace skips a version it already
has.
How to create the publisher, and the order to do it in, is docs/publishing.md.