Skip to content

Commit c01d715

Browse files
committed
CI: Set and update weekly the stable toolchain version
Currently we are using `stable` for the stable toolchain. This is ok but it means we get whatever the Rust project pushes. Instead lets be explicit so we know exactly what version we get. Also add a cron job to update it weekly.
1 parent 50a11bf commit c01d715

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Update Stable rustc
2+
on:
3+
schedule:
4+
- cron: "0 0 * * 5" # runs every Friday at 00:00 (generally rust releases on Thursday)
5+
workflow_dispatch: # allows manual triggering
6+
permissions: {}
7+
jobs:
8+
format:
9+
name: Update stable rustc
10+
runs-on: ubuntu-24.04
11+
permissions:
12+
contents: write
13+
id-token: write
14+
pull-requests: write
15+
steps:
16+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
17+
with:
18+
persist-credentials: false
19+
- name: Install cargo-rbmt
20+
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev $(cat rbmt-version) cargo-rbmt
21+
- name: Update stable toolchain in Cargo.toml
22+
run: |
23+
eval "$(cargo rbmt toolchains --update-stable)"
24+
echo "stable_version=$RBMT_STABLE" >> $GITHUB_ENV
25+
- name: Create Pull Request
26+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
27+
with:
28+
token: ${{ secrets.APOELSTRA_RUST_BITCOIN_ORG_CREATE_PR }}
29+
author: Update Stable Rustc Bot <bot@example.com>
30+
committer: Update Stable Rustc Bot <bot@example.com>
31+
title: Automated weekly update to rustc stable (to ${{ env.stable_version }})
32+
body: |
33+
Automated update to Cargo.toml workspace metadata by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
34+
commit-message: Automated update to rustc stable-${{ env.stable_version }}
35+
branch: create-pull-request/weekly-stable-update

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rust-version = "1.56.1"
1414

1515
[package.metadata.rbmt.toolchains]
1616
nightly = "nightly-2026-06-05"
17-
stable = "stable"
17+
stable = "1.95.0"
1818

1919
[features]
2020
default = ["std"]

0 commit comments

Comments
 (0)