Skip to content

feat: embed compile-time version in CLI help#15

Merged
0pendev merged 1 commit into
mainfrom
feat/versioning
Apr 13, 2026
Merged

feat: embed compile-time version in CLI help#15
0pendev merged 1 commit into
mainfrom
feat/versioning

Conversation

@0pendev
Copy link
Copy Markdown
Collaborator

@0pendev 0pendev commented Apr 13, 2026

Add -Dversion to build.zig (default dev) and wire the release workflow to pass the release tag so artifacts show the correct version in help output.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR embeds a compile-time version string into the CLI help output and wires the GitHub release workflow to pass the release tag into the Zig build so produced artifacts can display the correct version.

Changes:

  • Add a -Dversion build option (defaulting to dev) and expose it via build_options.
  • Print the embedded version as a banner before --help output.
  • Update the release workflow to pass the release tag to zig build as -Dversion.

Reviewed changes

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

File Description
src/main.zig Prints a version banner (from build_options.version) before generating clap help output.
build.zig Introduces -Dversion and injects it into the root module as build_options.
.github/workflows/release.yml Passes a version value to the build command during releases.

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

Comment thread src/main.zig
ref: ${{ inputs.release_tag }}
- uses: Ledger-Donjon/absolution/.github/actions/setup-zig@main
- run: zig build -Doptimize=${{ matrix.optimize }} -Dstrip=true
- run: zig build -Doptimize=${{ matrix.optimize }} -Dstrip=true -Dversion="${RELEASE_TAG}"
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

RELEASE_TAG is not defined in this workflow step (no env: assignment shown), so -Dversion will likely be empty at build time. Use the GitHub expression directly (e.g., -Dversion="${{ inputs.release_tag }}") or define env: RELEASE_TAG: ${{ inputs.release_tag }} for the step/job.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is defined at the workflow level no ?

Comment thread build.zig Outdated
Add -Dversion to build.zig (default dev) and wire the release workflow to pass the release tag so artifacts show the correct version in help output.
@0pendev 0pendev merged commit f3d64ae into main Apr 13, 2026
6 checks passed
@0pendev 0pendev deleted the feat/versioning branch April 20, 2026 09:34
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.

2 participants