diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfe1eb0..4ca5388 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,8 +9,30 @@ on: tags: ['v*'] jobs: + # Fail loudly if the release's versions disagree. The binary's --version comes + # from Cargo.toml (workspace version), the npm package from its package.json, + # and the release identity from the tag — nothing keeps them in sync, so bump + # them together or this gate stops the publish. (v0.2.1 shipped a binary still + # reporting 0.2.0 because only npm was bumped.) + verify-versions: + name: Verify versions match the tag + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Assert Cargo, npm, and tag versions agree + run: | + tag="${GITHUB_REF_NAME#v}" + cargo_ver="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)" + npm_ver="$(node -p "require('./npm/bulltui/package.json').version")" + echo "tag=$tag cargo=$cargo_ver npm=$npm_ver" + if [ "$tag" != "$cargo_ver" ] || [ "$tag" != "$npm_ver" ]; then + echo "::error::release version mismatch — tag=$tag cargo=$cargo_ver npm=$npm_ver (bump Cargo.toml and npm together)" + exit 1 + fi + build: name: Build ${{ matrix.npm-pkg }} + needs: verify-versions strategy: fail-fast: false matrix: diff --git a/Cargo.lock b/Cargo.lock index 515cbdb..0fc594d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "bullmq" -version = "0.1.0" +version = "0.2.2" dependencies = [ "anyhow", "futures-util", @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "bulltui" -version = "0.1.0" +version = "0.2.2" dependencies = [ "anyhow", "arboard", diff --git a/Cargo.toml b/Cargo.toml index fd73262..59c11b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["crates/bullmq", "crates/bulltui"] [workspace.package] -version = "0.2.0" +version = "0.2.2" edition = "2021" rust-version = "1.88" license = "Apache-2.0" diff --git a/justfile b/justfile index 9d46310..43e77b7 100644 --- a/justfile +++ b/justfile @@ -110,7 +110,13 @@ release: set -euo pipefail git switch main git pull --ff-only - version="v$(node -p "require('./npm/bulltui/package.json').version")" + npm_ver="$(node -p "require('./npm/bulltui/package.json').version")" + cargo_ver="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)" + if [ "$npm_ver" != "$cargo_ver" ]; then + echo "version drift: Cargo.toml=$cargo_ver npm=$npm_ver — bump both before releasing" >&2 + exit 1 + fi + version="v$npm_ver" git tag "$version" git push origin "$version" git push "https://$(gh auth token)@github.com/vinnymac/bulltui.git" "$version" diff --git a/npm/bulltui/CHANGELOG.md b/npm/bulltui/CHANGELOG.md index 3acdd7d..93f9cd2 100644 --- a/npm/bulltui/CHANGELOG.md +++ b/npm/bulltui/CHANGELOG.md @@ -1,5 +1,11 @@ # bulltui +## 0.2.2 + +### Patch Changes + +- sync the compiled binary version with the release. v0.2.1 bumped only the npm package, so `bulltui --version` still reported `0.2.0`; the Rust workspace version is now bumped alongside it, and the release pipeline fails loudly if the Cargo and npm versions drift. + ## 0.2.1 ### Patch Changes diff --git a/npm/bulltui/package.json b/npm/bulltui/package.json index e4022c3..66bc8b9 100644 --- a/npm/bulltui/package.json +++ b/npm/bulltui/package.json @@ -1,6 +1,6 @@ { "name": "bulltui", - "version": "0.2.1", + "version": "0.2.2", "description": "A fast, keyboard-driven terminal UI for BullMQ", "homepage": "https://tangled.sh/@vinnymac.dev/bulltui", "repository": {