Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jsando
Copy link
Owner

@jsando jsando commented Jun 29, 2025

Summary

  • Add version command to show version, commit, and build date
  • Support -v and --version flags
  • Create version package with build-time variables
  • Update release workflow to inject version info via ldflags

Implementation

Following the pattern used in jsando/mpu:

  • Version variables can be set at build time using ldflags
  • Default to 'dev' version for local development
  • Release builds automatically extract version from git tag

Testing

$ go run . version
jb version dev
 commit: none
 built: unknown

$ ./jb-test version  # built with ldflags
jb version 0.2.0-test
 commit: 78b9ac2
 built: 2025-06-29T23:08:36Z

- Create version package with build-time variables
- Add version command and -v/--version flags
- Update build output to show version
- Configure release workflow to inject version info via ldflags
- Version format follows mpu/fatimg pattern with version, commit, and date
@jsando jsando merged commit f88da58 into main Jun 29, 2025
13 checks passed
@jsando jsando deleted the dynamic-version branch June 29, 2025 23:19
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