Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,17 @@ jobs:
steps:
- uses: actions/checkout@v4

# Refuse to publish if the tag doesn't match the manifest version.
- name: Verify tag matches Cargo.toml version
run: |
TAG="${GITHUB_REF_NAME#v}"
CRATE="$(grep -m1 '^version' Cargo.toml | sed -E 's/.*"(.*)".*/\1/' | tr -d '[:space:]')"
echo "tag=$TAG Cargo.toml=$CRATE"
if [ "$TAG" != "$CRATE" ]; then
echo "::error::Tag v$TAG does not match Cargo.toml version $CRATE -- bump the version to match the tag before releasing."
exit 1
fi

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
Expand Down
Loading