Skip to content

ci: allow releasing the Go module on its own - #120

Merged
JeanExtreme002 merged 3 commits into
mainfrom
ci/release-go-alone
Aug 25, 2026
Merged

ci: allow releasing the Go module on its own#120
JeanExtreme002 merged 3 commits into
mainfrom
ci/release-go-alone

Conversation

@JeanExtreme002

Copy link
Copy Markdown
Owner

The Go module is the only package that cannot be published from the Actions
tab. tag-go-module runs on a release event alone, and a release event also
uploads to PyPI and npm — so releasing the Go SDK meant releasing all three, or
tagging by hand, which is how go/v1.6.0 went out.

What changes

target now offers go, and both becomes all now that there are three
packages to choose from:

dispatch PyPI npm Go tag
all
pypi
npm
go

A release event still publishes everything, exactly as before.

Where the tag points depends on how the job was started. From a release it is
the release's own tag, as today. By hand it is the dispatched commit — which is
what releasing the module on its own means: the other two packages did not
change, so there is no release tag to hang it from.

Guards

A published Go version is immutable in the module proxy — it cannot be deleted
or replaced, only retracted — so the job now refuses to:

  • tag a version that already exists, pointing at go/flightradarapi/doc.go to bump
  • tag a commit that carries no go/go.mod, which would cache an empty module forever

dry_run (on by default) reports what would be tagged and pushes nothing.

Testing

The workflow cannot run before it is merged, so the step's script was extracted
from the YAML and exercised directly, once per path:

dispatch, dry_run, new version   → Would tag go/v1.7.0 at 81807f2   exit 0
dispatch, version already out    → ::error::go/v1.6.0 already exists  exit 1
dispatch, commit without the SDK → ::error::…carries no go/go.mod     exit 1
release event, tag v9.9.9        → Would tag go/v9.9.9 at v9.9.9    exit 0

The malformed-tag case is already covered upstream: verify-versions compares
the release tag against the three declared versions before this job runs.

The Go module was the only package that could not be published from the
Actions tab: tag-go-module ran on a release event alone, and a release
event also uploads to PyPI and npm. That was the shape the Go port
needed the day it landed — the other two were already at 1.6.0 and had
nothing new to publish — and it had to be done by hand.

`target` now takes `go`, and `both` becomes `all` since there are three
packages to choose from. Run from a release the module tag still points
at the release's tag; run by hand it points at the dispatched commit,
which is what releasing the module alone means.

Two guards, because a published Go version is immutable in the proxy and
cannot be replaced: the job refuses a version that is already tagged, and
refuses a commit that carries no go/go.mod, which would otherwise cache
an empty module forever. `dry_run` reports what it would tag.
Review of the previous commit found that refusing an existing tag broke
the path this very change adds: dispatch the module tag at 1.7.0, then
publish the 1.7.0 release, and the release workflow goes red at a step
that has nothing left to do — with PyPI and npm already published, and
advice to bump a version that is correct. Re-running a release after a
transient upload failure hit the same wall.

The check now compares commits rather than names: the same commit is a
no-op, a different one is the immutable-version error it was meant to
be.

Two more, both about a push that cannot be taken back. A dispatch can be
started from any branch, so the commit now has to be on main. And the
dry-run guard read "true means dry run", which pushed for any other
value — including the empty string a trigger with no inputs would
produce; it now pushes only when told "false" in so many words.

The section in CONTRIBUTING promised a flow the version gate forbids:
bumping only the Go version fails verify-versions, so target: go
publishes the version the repository already declares, which is what it
is for.
The guards were hard failures even in a dry run, so the only way to try
a change to a dispatch — running it from its own branch — died at the
first one. They now report what they would refuse and leave the job
green: a rehearsal has nothing to undo.

The commit is resolved through the same path, rather than letting the
step die on a raw git message with no annotation, and the ancestry check
tells apart "not an ancestor" from git failing, so an infrastructure
problem stops reading as an accusation about the commit.

The tag job now runs after the two registry jobs. It is the only step
here that cannot be taken back, and a proxy that will serve a version
forever should not outlive an upload that was rejected. Skipped
dependencies would otherwise take the job with them on a single-target
dispatch, which the cancelled/failure guard prevents.
@JeanExtreme002
JeanExtreme002 merged commit 2e34c89 into main Aug 25, 2026
2 checks passed
@github-actions
github-actions Bot deleted the ci/release-go-alone branch August 25, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant