66 - " v*" # e.g. v0.2.1
77
88jobs :
9+ # ── version consistency check ──
10+ version-check :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v4
14+ - name : Verify version consistency
15+ run : |
16+ TAG="${GITHUB_REF#refs/tags/v}"
17+ echo "Tag version: $TAG"
18+ ERRORS=0
19+ check() {
20+ local file=$1 ver=$2
21+ if [ "$ver" != "$TAG" ]; then
22+ echo "::error file=$file::Version mismatch: $ver (expected $TAG)"
23+ ERRORS=$((ERRORS + 1))
24+ else
25+ echo "✓ $file: $ver"
26+ fi
27+ }
28+ check packages/core/package.json \
29+ "$(node -p "require('./packages/core/package.json').version")"
30+ for toml in packages/rust/crates/oxbitnet/Cargo.toml \
31+ packages/rust/crates/oxbitnet-ffi/Cargo.toml \
32+ packages/rust/crates/oxbitnet-java/Cargo.toml \
33+ packages/rust/crates/oxbitnet-python/Cargo.toml; do
34+ check "$toml" "$(grep -m1 '^version' "$toml" | sed 's/.*"\(.*\)"/\1/')"
35+ done
36+ check packages/rust/crates/oxbitnet-python/pyproject.toml \
37+ "$(grep -m1 '^version' packages/rust/crates/oxbitnet-python/pyproject.toml | sed 's/.*"\(.*\)"/\1/')"
38+ check packages/rust/crates/oxbitnet-java/java/build.gradle.kts \
39+ "$(grep -m1 '^version' packages/rust/crates/oxbitnet-java/java/build.gradle.kts | sed 's/.*"\(.*\)"/\1/')"
40+ exit $ERRORS
41+
942 # ── crates.io ──
1043 publish-crate :
44+ needs : version-check
1145 if : startsWith(github.ref, 'refs/tags/v')
1246 runs-on : ubuntu-latest
1347 steps :
2761
2862 # ── PyPI (maturin) ──
2963 build-wheels :
64+ needs : version-check
3065 if : startsWith(github.ref, 'refs/tags/v')
3166 runs-on : ${{ matrix.os }}
3267 strategy :
78113
79114 # ── npm ──
80115 publish-npm :
116+ needs : version-check
81117 if : startsWith(github.ref, 'refs/tags/v')
82118 runs-on : ubuntu-latest
83119 permissions :
@@ -103,6 +139,7 @@ jobs:
103139
104140 # ── Swift (XCFramework → GitHub Release) ──
105141 build-xcframework :
142+ needs : version-check
106143 if : startsWith(github.ref, 'refs/tags/v')
107144 runs-on : macos-latest
108145 steps :
@@ -190,6 +227,7 @@ jobs:
190227
191228 # ── Java (Maven Central) ──
192229 build-java-natives :
230+ needs : version-check
193231 if : startsWith(github.ref, 'refs/tags/v')
194232 runs-on : ${{ matrix.os }}
195233 strategy :
0 commit comments