Skip to content

Publish a GitHub Release when a version tag is pushed - #41

Merged
barkz merged 1 commit into
mainfrom
ci/publish-releases-on-tag
Sep 28, 2026
Merged

barkz merged 1 commit into
mainfrom
ci/publish-releases-on-tag

Conversation

@barkz

@barkz barkz commented Sep 28, 2026

Copy link
Copy Markdown
Owner

What

v0.2.40 was the repo's first tag, but nothing was wired to tags — so it produced no downloadable artifact. Pushing v* now builds the zipapp and creates a GitHub Release with it attached.

Why not the existing artifact

release.yml already builds glean-code.pyz, but uploads it via actions/upload-artifact, which expires after 90 days and can't be linked from a changelog. A Release asset is permanent and addressable.

Safeguards

  • needs: test — a tag cannot publish a build that doesn't pass the matrix.
  • Tag/version agreement — the job refuses to publish when the tag disagrees with __version__. I ran that check locally against both a matching tag (v0.2.41 → passes) and a mismatched one (v9.9.9 → ::error:: and exit 1).
  • version job stays PR-only — a tag push has no PR number to check against.

The two concepts stay separate

__version__ is the per-PR build identity (0.2.<PR>, this one is 0.2.41). A tag marks the builds worth handing to someone. Not every PR needs a tag.

🤖 Generated with Claude Code

The repo gained its first tag (v0.2.40) but nothing was wired to tags, so a tag
produced no downloadable artifact. release.yml already builds the zipapp, but it
uploads it as a CI artifact, which expires in 90 days and is awkward to link.

Pushing v* now runs a publish job that builds the zipapp and creates a GitHub
Release with it attached. It runs after the test matrix, so a tag cannot publish
a build that does not pass, and it refuses outright when the tag disagrees with
__version__ — verified by running that check against both a matching and a
mismatched tag.

The version job stays gated on pull_request: a tag push has no PR number to
check against.

This keeps the two concepts separate. __version__ is the per-PR build identity;
a tag is the marker for the builds worth handing to someone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@barkz
barkz merged commit b5ffbd9 into main Sep 28, 2026
9 checks passed
@barkz
barkz deleted the ci/publish-releases-on-tag branch September 28, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant