Skip to content

Publish the version the build job computed - #631

Merged
devhawk merged 1 commit into
mainfrom
version-override
Oct 20, 2026
Merged

devhawk merged 1 commit into
mainfrom
version-override

Conversation

@devhawk

@devhawk devhawk commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Each job in the Publish workflow checks out again and recomputes the version from git. If a tag is added after the build job has run, a later job publishes a different version from the one build computed. Two ways this happens:

  • createRelease --push on a release branch tags the commit while its run is in progress;
  • someone reruns a failed publish job after tagging.

Example: a push to release/v1.3 builds 1.3.1-rc2, so build reports a prerelease and publish-maven-central is skipped. The commit is then tagged 1.3.1. A rerun of publish-github-packages sees the tag and publishes 1.3.1 to GitHub Packages, while Maven Central never gets it.

Changes

  • GitVersion.version() returns DBOS_VERSION_OVERRIDE when it is set, and otherwise derives the version from git as before.
  • publish-github-packages and publish-maven-central set DBOS_VERSION_OVERRIDE from needs.build.outputs.version. They no longer compute the version, so they check out at the default depth instead of the full history. build still uses the full history.

I checked this in a depth-1 clone: with DBOS_VERSION_OVERRIDE=1.3.1, the build produces transact-1.3.1.jar with Implementation-Version: 1.3.1 and the correct SCM-Revision.

🤖 Generated with Claude Code

Each publish job checked out again and recomputed the version from git. A
tag added after the build job ran (createRelease on a release branch, or a
rerun of a failed job after tagging) made a job publish a different
version: an rc build's rerun could publish the bare release to GitHub
Packages while the Maven Central job, gated on the build job's version,
stayed skipped.

GitVersion now returns DBOS_VERSION_OVERRIDE when it is set, and the
publish jobs set it from the build job's version output. They no longer
need the full history, so they check out at the default depth.
@devhawk
devhawk requested review from kraftp, maxdml and qianl15 and a balanced review from Copilot October 19, 2026 21:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Both publishing jobs consistently use the build’s version, with no unresolved review findings.

No open issues 🎉

What changed in this PR

Ensures publishing uses the version computed by the build job, preventing later tags from changing the published version.

Changes:

  • Adds a nonblank DBOS_VERSION_OVERRIDE fallback ahead of Git-based version calculation.
  • Passes the build’s version to both publishing jobs and removes their full-history checkouts.
File Description
build-logic/​src/​main/​kotlin/​dev/​dbos/​build/​GitVersion.kt Uses the version override when provided.
.github/​workflows/​publish.yml Propagates the build version to publishing jobs and uses shallow checkouts.

Review effort: Balanced

@devhawk
devhawk merged commit 200117b into main Oct 20, 2026
23 of 25 checks passed
@devhawk
devhawk deleted the version-override branch October 20, 2026 15:56
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.

3 participants