File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,8 +9,49 @@ permissions:
99 contents : write
1010
1111jobs :
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
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ members = [
66resolver = " 2"
77
88[workspace .package ]
9- version = " 0.1.0 "
9+ version = " 0.0.3 "
1010edition = " 2021"
1111license = " MIT"
1212authors = [" Claudeform Contributors" ]
You can’t perform that action at this time.
0 commit comments