ci: fix release-plz workflow for auto release on main (#10)
* Create release-plz.yml * ci: configure release-plz auto-release workflow * ci: allow crates token from env vars fallback * ci: add release-pr flow and release commit filtering
This commit is contained in:
parent
0494561a21
commit
1b448b9d75
|
|
@ -0,0 +1,54 @@
|
||||||
|
name: release-plz
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-plz-release:
|
||||||
|
name: release-plz release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
environment: CRATE_RELEASE
|
||||||
|
steps:
|
||||||
|
- &checkout
|
||||||
|
name: Checkout repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- &install-rust
|
||||||
|
name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Run release-plz
|
||||||
|
uses: release-plz/action@v0.5
|
||||||
|
with:
|
||||||
|
command: release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN || vars.CARGO_REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
release-plz-pr:
|
||||||
|
name: release-plz PR
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
concurrency:
|
||||||
|
group: release-plz-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
steps:
|
||||||
|
- *checkout
|
||||||
|
- *install-rust
|
||||||
|
- name: Run release-plz
|
||||||
|
uses: release-plz/action@v0.5
|
||||||
|
with:
|
||||||
|
command: release-pr
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN || vars.CARGO_REGISTRY_TOKEN }}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
[workspace]
|
||||||
|
release_always = true
|
||||||
|
git_tag_enable = true
|
||||||
|
git_release_enable = true
|
||||||
|
publish = true
|
||||||
|
release_commits = '^(feat|fix|perf|refactor|revert|build)(\([^)]+\))?(!)?:'
|
||||||
Loading…
Reference in New Issue