Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 1.23 KB

File metadata and controls

69 lines (53 loc) · 1.23 KB

Dynamic Versioning

gutd uses dynamic versioning based on git tags at build time.

How it works

The build.rs script queries git to determine the version:

  1. On exact tag (e.g., v1.0.0): Shows tag name

    $ gutd --version
    gutd v1.0.0
  2. Between tags: Shows <latest-tag>-<commits>-g<hash>

    $ gutd --version
    gutd v1.0.0-5-ga53dbc4
  3. No tags: Shows short commit hash

    $ gutd --version
    gutd a53dbc4
  4. Uncommitted changes: Adds -dirty suffix

    $ gutd --version
    gutd v1.0.0-dirty
  5. No git repo: Falls back to Cargo.toml version

    $ gutd --version
    gutd 1.0.0

Version flags

# Show version
gutd --version
gutd -v

# Show help
gutd --help
gutd -h

CI/CD Integration

The version is automatically embedded at build time:

  • GitHub Actions builds include full git describe info
  • Release builds use tag version (e.g., v1.0.0)
  • Development builds show commit hash

Creating releases

# Tag a new version
git tag -a v1.0.1 -m "Release v1.0.1"
git push origin v1.0.1

# This triggers release workflow which:
# 1. Builds with version v1.0.1
# 2. Runs tests
# 3. Creates GitHub Release