ci: drop legacy release script in favor of cargo-rbmt
What changed, and why it matters
This commit is a routine update to the project's release automation. It removes an old shell script used for release checks and replaces it with a new tool called cargo-rbmt. There are no changes to the actual Bitcoin library code, no bug fixes, and no security-related changes.
No security action needed. Review as normal CI maintenance if desired.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit deletes .github/workflows/release.yml and contrib/release.sh, and adds a Prerelease job to .github/workflows/rust.yml that runs cargo rbmt prerelease. It also adds [prerelease] enabled = true to several rbmt.toml configuration files. The change is purely CI/infrastructure refactoring with no modifications to source code, APIs, or dependencies.
Changed components
.github/workflows/release.yml.github/workflows/rust.ymlcontrib/release.shbitcoin/rbmt.tomlconsensus_encoding/rbmt.tomlhashes/rbmt.tomlinternals/rbmt.tomlprimitives/rbmt.tomlunits/rbmt.tomlInspect captured patch +33 / −94
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index 4f8d40c5..00000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-on:
- push:
- branches:
- - master
- - 0.28.x
- - 0.29.x
- - 'test-ci/**'
- pull_request:
-
-name: Release
-permissions: {}
-
-jobs:
- release:
- name: Release - dry-run
- runs-on: ubuntu-24.04
- permissions:
- contents: write
- steps:
- - name: Checkout Crate
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- with:
- persist-credentials: false
- - name: Checkout Toolchain
- uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
- - name: run cargo
- run: contrib/release.sh
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index ae36bde1..3ef78537 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -45,6 +45,21 @@ jobs:
- name: "Run ${{ matrix.task }}"
run: cargo rbmt ${{ matrix.task }}
+ Prerelease:
+ runs-on: ubuntu-24.04
+ permissions:
+ contents: read
+ steps:
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ with:
+ persist-credentials: false
+ fetch-depth: 0 # History required for version bump detection.
+ - name: "Fetch master branch"
+ run: git fetch origin master:master
+ - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@9de0de1f36f65a2cb9c617358d88aecd319282d9
+ - name: "Run pre-release checks"
+ run: cargo rbmt prerelease
+
# Non cargo-rbmt jobs manage their toolchain version directly.
Prepare:
runs-on: ubuntu-24.04
diff --git a/bitcoin/rbmt.toml b/bitcoin/rbmt.toml
index d9c30d70..3e75057a 100644
--- a/bitcoin/rbmt.toml
+++ b/bitcoin/rbmt.toml
@@ -26,3 +26,6 @@ features_without_std = ["rand", "serde", "secp-recovery", "bitcoinconsensus", "b
allowed_duplicates = [
"hex-conservative",
]
+
+[prerelease]
+enabled = true
diff --git a/consensus_encoding/rbmt.toml b/consensus_encoding/rbmt.toml
index d8d3d998..72387c52 100644
--- a/consensus_encoding/rbmt.toml
+++ b/consensus_encoding/rbmt.toml
@@ -12,3 +12,6 @@ features_with_std = []
# Features to test without the `std` feature.
# Tests each feature alone, all pairs, and all together.
features_without_std = ["alloc"]
+
+[prerelease]
+enabled = true
diff --git a/contrib/release.sh b/contrib/release.sh
deleted file mode 100755
index 73abdd01..00000000
--- a/contrib/release.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env bash
-#
-# Check that we can publish crates in their current form if there are changes on top of the tip of
-# master that imply that we are about to do a release.
-#
-# disable follow sourced files.
-# shellcheck disable=SC1091
-
-set -euox pipefail
-
-REPO_DIR=$(git rev-parse --show-toplevel)
-
-# Sets CRATES to be a list of all crates in the repo.
-. "$REPO_DIR"/contrib/test_vars.sh
-
-main () {
- for crate in $CRATES; do
- if release_changes "$crate"; then
- echo "$crate has changes implying this is a release PR, checking if we can publish ..."
-
- # Check if there is any mention of TBD which means the
- # next version number should be filled in.
- if grep -qr "since = \"TBD" "./$crate"; then
- echo Version number needs to be filled in following places:
- grep -r "since = \"TBD" "./$crate"
- exit 1
- fi
-
- # Then try to dry-run cargo publish
- publish_dry_run "$crate"
- fi
- done
-}
-
-# Returns 0 if crate ($1) contains changes since tip of master that imply this patch set is done in
-# preparation for releasing the crate.
-
-release_changes() {
- local crate=$1
- set +e
-
- git log --patch --reverse master.. -- "$crate"/Cargo.toml | grep -E '\+version ='
- local exit_code=$?
-
- set -e
- return $exit_code
-}
-
-# Do a dry run publish to crates.io using the correct package name for crate ($1).
-# We use `set -e` so this will fail the script if the dry-run fails.
-publish_dry_run() {
- local crate=$1
- if [ "$crate" == "bitcoin" ]; then
- cargo publish -p "bitcoin" --dry-run
- elif [ "$crate" == "hashes" ]; then
- cargo publish -p "bitcoin_hashes" --dry-run
- elif [ "$crate" == "internals" ]; then
- cargo publish -p "bitcoin-internals" --dry-run
- elif [ "$crate" == "units" ]; then
- cargo publish -p "bitcoin-units" --dry-run
- fi
-}
-
-#
-# Main script.
-#
-main "$@"
diff --git a/hashes/rbmt.toml b/hashes/rbmt.toml
index 6d07c1a3..95f796d1 100644
--- a/hashes/rbmt.toml
+++ b/hashes/rbmt.toml
@@ -17,3 +17,6 @@ features_without_std = ["alloc", "serde", "small-hash"]
allowed_duplicates = [
"hex-conservative",
]
+
+[prerelease]
+enabled = true
diff --git a/internals/rbmt.toml b/internals/rbmt.toml
index 4d5687c6..aa0fee74 100644
--- a/internals/rbmt.toml
+++ b/internals/rbmt.toml
@@ -12,3 +12,6 @@ features_with_std = ["serde"]
# Features to test without the `std` feature.
# Tests each feature alone, all pairs, and all together.
features_without_std = ["alloc", "serde"]
+
+[prerelease]
+enabled = true
diff --git a/primitives/rbmt.toml b/primitives/rbmt.toml
index ba405803..b5d370c3 100644
--- a/primitives/rbmt.toml
+++ b/primitives/rbmt.toml
@@ -17,3 +17,6 @@ features_without_std = ["alloc", "serde", "arbitrary", "hex"]
allowed_duplicates = [
"hex-conservative",
]
+
+[prerelease]
+enabled = true
diff --git a/units/rbmt.toml b/units/rbmt.toml
index f5573628..7f430b26 100644
--- a/units/rbmt.toml
+++ b/units/rbmt.toml
@@ -12,3 +12,6 @@ features_with_std = ["serde", "arbitrary", "encoding"]
# Features to test without the `std` feature.
# Tests each feature alone, all pairs, and all together.
features_without_std = ["alloc", "serde", "arbitrary", "encoding"]
+
+[prerelease]
+enabled = true
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.