feat: embed compile-time version in CLI help#15
Conversation
There was a problem hiding this comment.
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
-Dversionbuild option (defaulting todev) and expose it viabuild_options. - Print the embedded version as a banner before
--helpoutput. - Update the release workflow to pass the release tag to
zig buildas-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.
| 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}" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
It is defined at the workflow level no ?
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.
dd567ab to
f3c1fb5
Compare
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.