71 lines
2.3 KiB
YAML
71 lines
2.3 KiB
YAML
name: Release-plz
|
|
|
|
# Set the permissions of the github token to the minimum and only enable what is needed
|
|
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions
|
|
permissions: {}
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
# Release unpublished packages.
|
|
release-plz-release:
|
|
name: Release-plz release
|
|
environment: release
|
|
permissions:
|
|
pull-requests: write
|
|
contents: write
|
|
id-token: write
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.repository_owner == 'ratatui' }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
|
with:
|
|
toolchain: stable
|
|
- uses: rust-lang/crates-io-auth-action@63a7064947ceca9989005e118db3a5fecdc9259f # v1
|
|
id: auth
|
|
- name: Run release-plz
|
|
uses: release-plz/action@8724d33cd97b8295051102e2e19ca592962238f5 # v0.5
|
|
with:
|
|
command: release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
|
|
|
# Create a PR with the new versions and changelog, preparing the next release.
|
|
release-plz-pr:
|
|
name: Release-plz PR
|
|
permissions:
|
|
pull-requests: write
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.repository_owner == 'ratatui' }}
|
|
concurrency:
|
|
group: release-plz-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # master
|
|
with:
|
|
toolchain: stable
|
|
- name: Run release-plz
|
|
uses: release-plz/action@8724d33cd97b8295051102e2e19ca592962238f5 # v0.5
|
|
with:
|
|
command: release-pr
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
|