Skip to content

Commit ac14877

Browse files
authored
ci: add release-plz to CI release workflow (#3)
Signed-off-by: Esteve Fernandez <esteve@apache.org>
1 parent 88f530f commit ac14877

2 files changed

Lines changed: 73 additions & 0 deletions

File tree

.github/workflows/release-plz.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Release-plz
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release-plz-release:
10+
name: Release-plz release
11+
runs-on: ubuntu-latest
12+
if: ${{ github.repository_owner == 'ros2-rust' }}
13+
permissions:
14+
contents: write
15+
steps:
16+
# Generating a GitHub token, so that PRs and tags created by
17+
# the release-plz-action can trigger actions workflows.
18+
- name: Generate GitHub token
19+
uses: actions/create-github-app-token@v2
20+
id: generate-token
21+
with:
22+
app-id: ${{ secrets.APP_ID }}
23+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
token: ${{ steps.generate-token.outputs.token }}
29+
- name: Install Rust toolchain
30+
uses: dtolnay/rust-toolchain@stable
31+
- name: Run release-plz
32+
uses: release-plz/action@v0.5
33+
with:
34+
command: release
35+
env:
36+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
37+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
38+
39+
release-plz-pr:
40+
name: Release-plz PR
41+
runs-on: ubuntu-latest
42+
if: ${{ github.repository_owner == 'ros2-rust' }}
43+
permissions:
44+
pull-requests: write
45+
contents: write
46+
concurrency:
47+
group: release-plz-${{ github.ref }}
48+
cancel-in-progress: false
49+
steps:
50+
# Generating a GitHub token, so that PRs and tags created by
51+
# the release-plz-action can trigger actions workflows.
52+
- name: Generate GitHub token
53+
uses: actions/create-github-app-token@v2
54+
id: generate-token
55+
with:
56+
app-id: ${{ secrets.APP_ID }}
57+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
58+
- name: Checkout repository
59+
uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
token: ${{ steps.generate-token.outputs.token }}
63+
- name: Install Rust toolchain
64+
uses: dtolnay/rust-toolchain@stable
65+
- name: Run release-plz
66+
uses: release-plz/action@v0.5
67+
with:
68+
command: release-pr
69+
env:
70+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
71+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

release-plz.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[workspace]
2+

0 commit comments

Comments
 (0)