-
Notifications
You must be signed in to change notification settings - Fork 0
Centralize version management and extract usage text #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Extract usage text to src/assets/usage.txt using @embedfile - Read version from build.zig.zon via build options - Update release workflow to set version from git tag - Use 0.0.0-dev as placeholder version in repository Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
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 centralizes version management and extracts usage text to improve maintainability. The version is now read from build.zig.zon via build options, and the release workflow automatically updates it from git tags. The usage text has been moved to a separate asset file for easier editing.
Changes:
- Extracted usage text from inline string to
src/assets/usage.txt - Centralized version management by reading from
build.zig.zonthrough build options - Updated release workflow to set version from git tag before building
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main.zig | Imports build options and usage text file; updates version and usage display functions |
| src/assets/usage.txt | New file containing the extracted usage text with updated ASCII art |
| build.zig.zon | Sets placeholder version 0.0.0-dev with comment explaining replacement during release |
| build.zig | Adds build options to pass version from build.zig.zon to compiled binary |
| .github/workflows/release.yml | Adds step to update version in build.zig.zon from git tag before building |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/release.yml
Outdated
| sed -i.bak "s/\.version = \"[^\"]*\",/.version = \"${VERSION}\",/" build.zig.zon | ||
| rm -f build.zig.zon.bak |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sed command uses -i.bak which creates a backup file on macOS/BSD but behaves differently on Linux. For cross-platform compatibility in GitHub Actions (which runs on Linux), use sed -i without the .bak extension, then remove the separate rm -f build.zig.zon.bak line.
| sed -i.bak "s/\.version = \"[^\"]*\",/.version = \"${VERSION}\",/" build.zig.zon | |
| rm -f build.zig.zon.bak | |
| sed -i "s/\.version = \"[^\"]*\",/.version = \"${VERSION}\",/" build.zig.zon |
Remove unnecessary .bak extension and cleanup since GitHub Actions runs on Linux Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use prefers-color-scheme media query to switch fill color: - Light mode: black (#000000) - Dark mode: white (#ffffff) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix logo image URL to point to correct repository - Add README.ja.md with Japanese translation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
src/assets/usage.txtfor easier maintenancebuild.zig.zonvia build options0.0.0-devas placeholder version in repository (replaced during release)Test plan
zig buildsucceedszig build testpassesdraft versionshows0.0.0-devfor local builds🤖 Generated with Claude Code