Skip to content

Validate release tags against Cargo version#833

Merged
kitsuyui merged 1 commit into
mainfrom
validate-release-version-tag
May 25, 2026
Merged

Validate release tags against Cargo version#833
kitsuyui merged 1 commit into
mainfrom
validate-release-version-tag

Conversation

@kitsuyui

Copy link
Copy Markdown
Owner

Summary

  • Add a release-tag validation step to the binary release workflow.
  • Add the same validation before crates.io dry-run or publish steps.
  • Accept both vX.Y.Z and X.Y.Z tags by comparing the normalized tag with the Cargo package version.

Changed files

  • .github/workflows/binary-release.yml
  • .github/workflows/cratesio-publish.yml

Verification

  • GITHUB_REF_NAME=v0.2.5 ... tag/version match simulation
  • GITHUB_REF_NAME=v9.9.9 ... mismatch simulation
  • cargo fmt --all -- --check
  • cargo check
  • cargo test
  • cargo clippy -- -D warnings
  • cargo build
  • typos
  • actionlint -shellcheck=
  • cargo llvm-cov --lcov --output-path coverage.lcov
  • git diff --check

Check the normalized release tag against the Cargo package version before
building release artifacts or publishing to crates.io.

This prevents a GitHub release tag from drifting away from the version
compiled into the binary and published package.
@github-actions

Copy link
Copy Markdown

Code Metrics Report

main (0a31f22) #833 (0454645) +/-
Coverage 69.3% 69.3% 0.0%
Code to Test Ratio 1:0.0 1:0.0 0.0
Test Execution Time 10s 18s +8s
Details
  |                     | main (0a31f22) | #833 (0454645) | +/-  |
  |---------------------|----------------|----------------|------|
  | Coverage            |          69.3% |          69.3% | 0.0% |
  |   Files             |             18 |             18 |    0 |
  |   Lines             |           1816 |           1816 |    0 |
  |   Covered           |           1260 |           1260 |    0 |
  | Code to Test Ratio  |          1:0.0 |          1:0.0 |  0.0 |
  |   Code              |           2375 |           2375 |    0 |
  |   Test              |              0 |              0 |    0 |
- | Test Execution Time |            10s |            18s |  +8s |

Reported by octocov

@kitsuyui
kitsuyui merged commit 260c784 into main May 25, 2026
16 checks passed
@kitsuyui
kitsuyui deleted the validate-release-version-tag branch May 25, 2026 13:44
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