Skip to content

Update MSRV

Update MSRV #3

Workflow file for this run

name: Update MSRV
permissions:
contents: write
on:
workflow_call:
workflow_dispatch:
jobs:
update-msrv:
runs-on: ubuntu-latest
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- run: git pull
- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: cargo-bins/cargo-binstall@main
- name: Install cargo-msrv
uses: taiki-e/install-action@v2
with:
tool: cargo-msrv
- name: Get msrv data
id: data-msrv
run: |
current_msrv=$(cargo msrv show --output-format minimal);
echo "current msrv: $current_msrv";
echo "current=$current_msrv" >> "$GITHUB_OUTPUT";
new_msrv=$(cargo msrv find --min $current_msrv --output-format minimal);
echo "new msrv: $new_msrv";
echo "new=$new_msrv" >> "$GITHUB_OUTPUT";
- name: Update cargo msrv
run: cargo msrv set ${{ steps.data-msrv.outputs.new }}
- name: Update readme msrv
uses: jacobtomlinson/gha-find-replace@v3
with:
find: ${{ steps.data-msrv.outputs.current }}
replace: ${{ steps.data-msrv.outputs.new }}
regex: false
include: "README.md"
- run: git pull
- name: Commit and Push
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update MSRV from [${{steps.data-msrv.outputs.current}}] to [${{steps.data-msrv.outputs.new}}]"