name: Update
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
concurrency:
group: update-${{ github.ref }}
cancel-in-progress: true
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Rust version
id: rust-version
run: |
RUST_VERSION=$(grep '^rust-version = ' Cargo.toml | sed 's/rust-version = "\(.*\)"/\1/')
echo "version=$RUST_VERSION" >> $GITHUB_OUTPUT
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.rust-version.outputs.version }}
- name: Install nightly Rust for formatting
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: msrv
- name: Format code with nightly
run: cargo +nightly fmt
- name: Install release-plz
uses: taiki-e/install-action@v2
with:
tool: release-plz
- name: Create release PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
release-plz release-pr --git-token "$GITHUB_TOKEN" || {
echo "::error::release-plz release-pr failed"
exit 1
}