Skip to content

Commit 1a47d23

Browse files
committed
ci(release): add release-plz workflow
1 parent 1f261e6 commit 1a47d23

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/release-plz.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release-plz
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
10+
# Release unpublished packages.
11+
release-plz-release:
12+
name: Release-plz release
13+
runs-on: ubuntu-latest
14+
if: ${{ github.repository_owner == 'coko7' }}
15+
permissions:
16+
contents: write
17+
pull-requests: read
18+
steps:
19+
- &checkout
20+
name: Checkout repository
21+
uses: actions/checkout@v6
22+
with:
23+
fetch-depth: 0
24+
persist-credentials: false
25+
- &install-rust
26+
name: Install Rust toolchain
27+
uses: dtolnay/rust-toolchain@stable
28+
- name: Run release-plz
29+
uses: release-plz/action@v0.5
30+
with:
31+
command: release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
35+
36+
# Create a PR with the new versions and changelog, preparing the next release.
37+
release-plz-pr:
38+
name: Release-plz PR
39+
runs-on: ubuntu-latest
40+
if: ${{ github.repository_owner == 'coko7' }}
41+
permissions:
42+
contents: write
43+
pull-requests: write
44+
concurrency:
45+
group: release-plz-${{ github.ref }}
46+
cancel-in-progress: false
47+
steps:
48+
- *checkout
49+
- *install-rust
50+
- name: Run release-plz
51+
uses: release-plz/action@v0.5
52+
with:
53+
command: release-pr
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)