From 7fab6fb26fa25eec921543fde766adfd57165f68 Mon Sep 17 00:00:00 2001 From: Gaurav Chaudhary Date: Thu, 10 Sep 2026 16:36:55 +0530 Subject: [PATCH 1/2] ci: move rbmt version pin to Cargo.toml Use Cargo metadata as the version source for installation and weekly updates, enabling rbmt's runtime version check. Generated with assistance from OpenAI Codex. Assisted-by: GPT-6 Astra Signed-off-by: Gaurav Chaudhary --- .github/actions/setup-rbmt/action.yml | 6 ++---- .github/workflows/cron-weekly-update-nightly.yml | 2 +- .github/workflows/cron-weekly-update-rbmt.yml | 15 +++++++-------- Cargo.toml | 3 +++ rbmt-version | 1 - 5 files changed, 13 insertions(+), 14 deletions(-) delete mode 100644 rbmt-version diff --git a/.github/actions/setup-rbmt/action.yml b/.github/actions/setup-rbmt/action.yml index 5a11b7e79..1b8e2171c 100644 --- a/.github/actions/setup-rbmt/action.yml +++ b/.github/actions/setup-rbmt/action.yml @@ -8,10 +8,8 @@ runs: shell: bash run: | cargo install \ - --git https://git.rust-bitcoin.org/rust-bitcoin/rust-bitcoin-maintainer-tools \ - --rev "$(cat rbmt-version)" \ - cargo-rbmt \ - --locked + --locked \ + "cargo-rbmt@$(grep '^rbmt\.version' Cargo.toml | cut -d'"' -f2)" - name: "Install Rust toolchains via cargo-rbmt" shell: bash diff --git a/.github/workflows/cron-weekly-update-nightly.yml b/.github/workflows/cron-weekly-update-nightly.yml index dd5ae4a90..08fa2f7ed 100644 --- a/.github/workflows/cron-weekly-update-nightly.yml +++ b/.github/workflows/cron-weekly-update-nightly.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install cargo-rbmt - run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev $(cat rbmt-version) cargo-rbmt --locked + run: cargo install --locked "cargo-rbmt@$(grep '^rbmt\.version' Cargo.toml | cut -d'"' -f2)" - name: Update nightly toolchain in Cargo.toml run: | cargo rbmt toolchains --update-nightly diff --git a/.github/workflows/cron-weekly-update-rbmt.yml b/.github/workflows/cron-weekly-update-rbmt.yml index 16ec2b127..415f3ac16 100644 --- a/.github/workflows/cron-weekly-update-rbmt.yml +++ b/.github/workflows/cron-weekly-update-rbmt.yml @@ -21,15 +21,14 @@ jobs: git clone --filter=blob:none --no-checkout \ https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git /tmp/rbmt LATEST_TAG=$(git -C /tmp/rbmt tag --sort=-version:refname | grep '^cargo-rbmt-' | head -1) - LATEST_HASH=$(git -C /tmp/rbmt rev-parse "${LATEST_TAG}^{}") - CURRENT_HASH=$(cat rbmt-version) - if [ -n "${LATEST_HASH}" ] && [ "${LATEST_HASH}" != "${CURRENT_HASH}" ]; then - echo "${LATEST_HASH}" > rbmt-version - echo "rbmt_hash=${LATEST_HASH}" >> "${GITHUB_ENV}" - echo "rbmt_semver=${LATEST_TAG#cargo-rbmt-}" >> "${GITHUB_ENV}" + LATEST_VERSION=${LATEST_TAG#cargo-rbmt-} + CURRENT_VERSION=$(grep '^rbmt\.version' Cargo.toml | cut -d'"' -f2) + if [ -n "${LATEST_VERSION}" ] && [ "${LATEST_VERSION}" != "${CURRENT_VERSION}" ]; then + sed -i "s/^rbmt\.version = .*/rbmt.version = \"${LATEST_VERSION}\"/" Cargo.toml + echo "rbmt_semver=${LATEST_VERSION}" >> "${GITHUB_ENV}" echo "changes_made=true" >> "${GITHUB_ENV}" else - echo "rbmt-version is already at the latest release. Not opening any PR." + echo "rbmt version is already at the latest release. Not opening any PR." echo "changes_made=false" >> "${GITHUB_ENV}" fi - name: Create Pull Request @@ -41,6 +40,6 @@ jobs: committer: Update RBMT Bot title: Automated weekly update to cargo-rbmt (to ${{ env.rbmt_semver }}) body: | - Automated update to rbmt-version by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action + Automated update to Cargo.toml workspace metadata by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action commit-message: Automated update to cargo-rbmt-${{ env.rbmt_semver }} branch: create-pull-request/weekly-rbmt-update diff --git a/Cargo.toml b/Cargo.toml index 020954783..cb6f61d09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -142,6 +142,9 @@ workspace = true members = ["fuzz"] exclude = ["embedded", "bitcoind-tests"] +[workspace.metadata] +rbmt.version = "0.5.3" + [workspace.metadata.rbmt.toolchains] nightly = "nightly-2026-08-21" stable = "1.95.0" diff --git a/rbmt-version b/rbmt-version deleted file mode 100644 index 77e33bfe9..000000000 --- a/rbmt-version +++ /dev/null @@ -1 +0,0 @@ -1c7c7d9d49addb2e44ec044d337ec5ccb1e14c08 From e5e1ee5a22c57162b7d09202ee5defaaf7d9f938 Mon Sep 17 00:00:00 2001 From: Gaurav Chaudhary Date: Thu, 10 Sep 2026 16:36:55 +0530 Subject: [PATCH 2/2] just: align developer commands with rbmt CI Use the pinned formatter and CI defaults for docs and benchmarks. Preserve the benchmark filter and conservative lockfile helper. Signed-off-by: Gaurav Chaudhary --- justfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/justfile b/justfile index 9b6e6a150..1d1bbfc21 100644 --- a/justfile +++ b/justfile @@ -15,19 +15,19 @@ lint: # Run the formatter. fmt: - cargo +nightly fmt + cargo rbmt fmt # Check the formatting. fmt-check: - cargo +nightly fmt --check + cargo rbmt fmt --check # Run the benchmark suite. bench: - RUSTFLAGS='--cfg=bench' cargo +nightly bench benchmarks + RUSTFLAGS='--cfg=bench' cargo rbmt run --toolchain nightly -- bench benchmarks # Build the docs (same as for docs.rs). docsrs: - RUSTDOCFLAGS="--cfg docsrs" cargo +nightly rustdoc --all-features -- -D rustdoc::broken-intra-doc-links + cargo rbmt docs # Quick and dirty CI useful for pre-push checks. sane: fmt-check lint