Skip to content

Commit 566cb80

Browse files
committed
Update the Release-plz workflow to use trusted publishing
1 parent 0fbbd1b commit 566cb80

File tree

1 file changed

+40
-9
lines changed

1 file changed

+40
-9
lines changed

.github/workflows/release-plz.yml

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,58 @@
1-
name: Release Plz
2-
3-
permissions:
4-
pull-requests: write
5-
contents: write
1+
name: Release-plz
62

73
on:
84
push:
95
branches:
106
- main
117

128
jobs:
13-
release-plz:
14-
name: Release-plz
9+
release-plz-release:
10+
name: Release-plz release
1511
runs-on: ubuntu-latest
12+
if: ${{ github.repository_owner == 'matrix-org' }}
13+
permissions:
14+
contents: write
15+
id-token: write
1616
steps:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
21+
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
2122
- name: Install Rust toolchain
2223
uses: dtolnay/rust-toolchain@stable
24+
- name: Authenticate with crates.io
25+
uses: rust-lang/crates-io-auth-action@v1
26+
id: auth
2327
- name: Run release-plz
24-
uses: MarcoIeni/release-plz-action@v0.5
28+
uses: release-plz/action@v0.5
29+
with:
30+
command: release
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
33+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
34+
35+
release-plz-pr:
36+
name: Release-plz PR
37+
runs-on: ubuntu-latest
38+
if: ${{ github.repository_owner == 'matrix-org' }}
39+
permissions:
40+
pull-requests: write
41+
contents: write
42+
concurrency:
43+
group: release-plz-${{ github.ref }}
44+
cancel-in-progress: false
45+
steps:
46+
- name: Checkout repository
47+
uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0
50+
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
51+
- name: Install Rust toolchain
52+
uses: dtolnay/rust-toolchain@stable
53+
- name: Run release-plz
54+
uses: release-plz/action@v0.5
55+
with:
56+
command: release-pr
2557
env:
2658
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
27-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)