Skip to content

Infer version from git tags#951

Merged
MikeMcQuaid merged 1 commit into
mainfrom
infer-version-from-git-tags
Apr 28, 2026
Merged

Infer version from git tags#951
MikeMcQuaid merged 1 commit into
mainfrom
infer-version-from-git-tags

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Contributor
  • Avoid stale VERSION values causing gems to build with filenames that differ from the release tag.
  • Let release builds set LICENSED_VERSION before publishing so the installed gem no longer needs git.
  • Cover Homebrew's licensed version and gem filename expectations.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR changes how Licensed::VERSION is determined so releases and built gems derive their version from git tags (or a build-time env var), avoiding mismatches between release tags and gem filenames/installed versions.

Changes:

  • Compute Licensed::VERSION from (in order) loaded gemspec version, LICENSED_VERSION, or git describe --tags --abbrev=0.
  • Update release workflow to export LICENSED_VERSION and ensure tags are available in CI (fetch-depth: 0).
  • Add/adjust tests to validate version resolution and CLI version output expectations.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/licensed/version.rb Implements dynamic version inference via loaded spec / env var / git tags.
test/version_test.rb Adds coverage for VERSION inference and gemspec versioning behavior.
test/cli_test.rb Updates CLI version tests to assert installed gem version output.
README.md Updates release instructions to rely on vX.Y.Z tags instead of editing version.rb.
.github/workflows/release.yml Fetches full git history/tags and sets LICENSED_VERSION for release builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/licensed/version.rb Outdated
Comment thread lib/licensed/version.rb Outdated
Comment thread lib/licensed/version.rb Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread lib/licensed/version.rb Outdated
@MikeMcQuaid MikeMcQuaid force-pushed the infer-version-from-git-tags branch 3 times, most recently from bc94d2c to af1792c Compare April 28, 2026 14:26
@MikeMcQuaid MikeMcQuaid requested a review from Copilot April 28, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Infer the next patch version from `git describe` when a checkout is
  past the latest tag.
- Fetch tags in publishing workflows and verify built gems before
  they can publish or update licensed artefacts.
- Keep shallow CI fast by falling back to the locked path-gem version.
- Use the installed gemspec version at runtime so published gems do
  not need `git`; report `git describe` failures clearly.
@MikeMcQuaid MikeMcQuaid force-pushed the infer-version-from-git-tags branch from af1792c to c20a43b Compare April 28, 2026 15:17
@MikeMcQuaid MikeMcQuaid merged commit 5cefad3 into main Apr 28, 2026
45 checks passed
@MikeMcQuaid MikeMcQuaid deleted the infer-version-from-git-tags branch April 28, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants