Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,34 @@ env:
CARGO_TERM_COLOR: always

jobs:
verify-version:
name: Verify tag matches Cargo.toml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Compare tag against Cargo.toml version
shell: bash
run: |
set -euo pipefail
# Tag looks like "refs/tags/v2.1.1"; strip the prefix and leading "v".
tag="${GITHUB_REF#refs/tags/}"
tag_version="${tag#v}"

# Pull the [package] version out of Cargo.toml (first `version = "..."`).
cargo_version=$(grep -m1 '^version = ' Cargo.toml | sed -E 's/.*"([^"]+)".*/\1/')

echo "Tag version: ${tag_version}"
echo "Cargo.toml version: ${cargo_version}"

if [[ "${tag_version}" != "${cargo_version}" ]]; then
echo "::error::Release tag v${tag_version} does not match Cargo.toml version ${cargo_version}. Bump Cargo.toml (and Cargo.lock) before tagging."
exit 1
fi
echo "OK: tag and Cargo.toml agree on ${cargo_version}"

build:
needs: [verify-version]
uses: ./.github/workflows/build.yml

publish:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage = "https://github.com/staehle/tise"
repository = "https://github.com/staehle/tise"
license-file = "LICENSE"
categories = ["games"]
version = "2.1.0"
version = "2.1.1"
edition = "2024"

[lib]
Expand Down
Loading