Skip to content

Release-plz

Release-plz #92

Workflow file for this run

name: Release-plz
on:
workflow_run:
workflows: ["Rust"]
branches: [main]
types:
- completed
jobs:
# Release unpublished packages.
release-plz-release:
name: Release-plz release
runs-on: macos-latest
environment: release
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry and release-plz
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin/release-plz
key: ${{ runner.os }}-cargo-release-plz-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-plz-
- name: Install release-plz
run: command -v release-plz || cargo install release-plz
- name: Run release-plz
run: release-plz release --git-token ${{ secrets.RELEASE_PLZ_TOKEN }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
# Create a PR with the new versions and changelog, preparing the next release.
release-plz-pr:
name: Release-plz PR
runs-on: macos-latest
environment: release
if: ${{ github.event.workflow_run.conclusion == 'success' }}
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry and release-plz
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin/release-plz
key: ${{ runner.os }}-cargo-release-plz-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-plz-
- name: Install release-plz
run: command -v release-plz || cargo install release-plz
- name: Run release-plz
run: release-plz release-pr --git-token ${{ secrets.RELEASE_PLZ_TOKEN }}