Replace build number formula with github.run_number#190
Merged
Conversation
The previous formula (major*100000 + minor*1000 + patch) was a custom scheme that could collide at component values >= 1000 and required contributors to understand the derivation. github.run_number is a built-in monotonic counter that auto-increments per workflow run — simpler, no edge cases, standard practice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the custom build number derivation formula
(
major*100000 + minor*1000 + patch) withgithub.run_number. Theformula was a bespoke scheme that could collide at component values >= 1000
and was one more thing contributors had to understand.
github.run_numberis a built-in monotonic counter that just goes up — no math, no edge cases.
Sparkle only needs build numbers to increase between releases. It doesn't
care about gaps or specific values.
Validation
github.run_numberis currently at ~27 for this workflow, which is higherthan the previous build number of 6 (from v0.0.6-beta). Sparkle will see
the next release as an upgrade.
Cannot test the actual
github.run_numberinjection locally — it's aGitHub Actions context variable. Verified the YAML is structurally correct
and the metadata step still emits
build_numbertoGITHUB_OUTPUT.Linked issues
Refs #185
Risk / rollout notes
This is fine — Sparkle only checks "is the new number higher?"
workflow_dispatchdry runs consume run numbers. This is expected andharmless — numbers just need to go up, not be sequential.
Greptile Summary
Replaces the custom build number derivation formula (
major*100000 + minor*1000 + patch) in the release workflow with GitHub's built-ingithub.run_number. The old formula was unnecessary complexity that could collide for component values ≥ 1000 and required a separate validation guard;github.run_numberis always a positive integer so both the formula and the guard are cleanly removed.build_numbervariable is now set directly to${{ github.run_number }}inside theResolve release metadatastep; all subsequent steps (Archive signed app,Generate signed appcast,Release summary) consume it identically throughsteps.metadata.outputs.build_number— no other changes required.-z \"${build_number}\" || \"${build_number}\" -le 0) was genuinely unnecessary forgithub.run_number, which the GitHub Actions runtime guarantees is always a positive integer starting from 1.Confidence Score: 5/5
This is a safe, surgical change that removes nine lines of formula-and-validation logic and replaces them with a single well-understood GitHub Actions built-in.
The change is minimal and correct. github.run_number is monotonically increasing and always a positive integer, so removing the old validation guard leaves no gap in correctness. All downstream consumers of build_number remain unmodified and continue to work through the same steps.metadata.outputs reference. The jump in build number value from ~6 to ~28 is intentional and harmless for Sparkle's update detection.
No files require special attention.
Important Files Changed
Reviews (1): Last reviewed commit: "Replace build number formula with github..." | Re-trigger Greptile