Skip to content

build: Build-metadata usage via go:embed #689

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

SchulteDev
Copy link

Refactor build metadata injection logic:

  • Introduced build_info package to manage version, commit, and date details.
  • Removed ldflags-based metadata injection.
  • Updated workflows and Dockerfile to prepare build_info files.
  • Added unit tests for build_info initialization and formatting.
    Because: Since build-metadata no longer needs compiling to binary, this information can already be defined at the source code level.
    Related feat: enable go run execution by moving main to root #630

Refactor build metadata injection logic:
- Introduced `build_info` package to manage version, commit, and date details.
- Removed ldflags-based metadata injection.
- Updated workflows and Dockerfile to prepare `build_info` files.
- Added unit tests for `build_info` initialization and formatting.
Because: Since build-metadata no longer needs compiling to binary, this information can already be defined at the source code level.
Related github#630
@SchulteDev SchulteDev requested a review from a team as a code owner July 16, 2025 18:23
- Extracted `build_info` preparation logic to `script/prepare-build-info`.
- Updated Dockerfile and GitHub workflows to use the new script.
- Simplified metadata injection process for better reusability.
- Replaced direct file paths with relative command paths in scripts and config files for consistency.
- Enhanced build info generation with improved handling of commit and branch information.
- Updated `.gitignore` to include dynamic build info files.
- Enabled write access in Dockerfile bind mount to align with changes.
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.

1 participant