Skip to content

Commit 904aa9c

Browse files
chore: set version to 0.0.3 and enforce tag parity in release workflow
1 parent 606934b commit 904aa9c

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,49 @@ permissions:
99
contents: write
1010

1111
jobs:
12+
validate-tag-version:
13+
name: validate-tag-version
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Validate tag matches Cargo version
20+
shell: bash
21+
run: |
22+
set -euo pipefail
23+
tag="${GITHUB_REF_NAME}"
24+
cargo_version="$(
25+
awk '
26+
/^\[workspace\.package\]/ { in_section=1; next }
27+
/^\[/ { if (in_section) exit }
28+
in_section && $1 == "version" {
29+
gsub(/"/, "", $3)
30+
print $3
31+
exit
32+
}
33+
' Cargo.toml
34+
)"
35+
36+
if [[ -z "${cargo_version}" ]]; then
37+
echo "Could not resolve workspace.package.version from Cargo.toml" >&2
38+
exit 1
39+
fi
40+
41+
expected_tag="v${cargo_version}"
42+
if [[ "${tag}" != "${expected_tag}" ]]; then
43+
echo "Tag/version mismatch:" >&2
44+
echo " tag: ${tag}" >&2
45+
echo " Cargo.toml workspace version: ${cargo_version}" >&2
46+
echo " expected tag: ${expected_tag}" >&2
47+
exit 1
48+
fi
49+
50+
echo "Tag/version check passed: ${tag}"
51+
1252
build:
1353
name: build-${{ matrix.archive_os }}-${{ matrix.archive_arch }}
54+
needs: [validate-tag-version]
1455
runs-on: ${{ matrix.runner }}
1556
strategy:
1657
fail-fast: false

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ members = [
66
resolver = "2"
77

88
[workspace.package]
9-
version = "0.1.0"
9+
version = "0.0.3"
1010
edition = "2021"
1111
license = "MIT"
1212
authors = ["Claudeform Contributors"]

0 commit comments

Comments
 (0)