Skip to content

Commit 5839f99

Browse files
authored
chore: update release-plz workflow (#646)
The default workflow described in the release-plz documentation has changed and so we're updating to take advantage of some of the newer safeguards put in place. Workflow taken from: https://release-plz.dev/docs/github/quickstart
1 parent 51b9010 commit 5839f99

File tree

1 file changed

+39
-7
lines changed

1 file changed

+39
-7
lines changed

.github/workflows/release-plz.yml

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,50 @@ on:
1010
- main
1111

1212
jobs:
13-
release-plz:
14-
name: Release-plz
13+
14+
# Release unpublished packages.
15+
release-plz-release:
16+
name: Release-plz release
1517
runs-on: ubuntu-latest
18+
if: ${{ github.repository_owner == 'tokio-rs' }}
19+
permissions:
20+
contents: write
1621
steps:
17-
- name: Checkout repository
18-
uses: actions/checkout@v4
22+
- &checkout
23+
name: Checkout repository
24+
uses: actions/checkout@v5
1925
with:
2026
fetch-depth: 0
21-
- name: Install Rust toolchain
27+
persist-credentials: false
28+
- &install-rust
29+
name: Install Rust toolchain
2230
uses: dtolnay/rust-toolchain@stable
2331
- name: Run release-plz
24-
uses: MarcoIeni/[email protected]
32+
uses: release-plz/[email protected]
33+
with:
34+
command: release
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
38+
39+
# Create a PR with the new versions and changelog, preparing the next release.
40+
release-plz-pr:
41+
name: Release-plz PR
42+
runs-on: ubuntu-latest
43+
if: ${{ github.repository_owner == 'tokio-rs' }}
44+
permissions:
45+
contents: write
46+
pull-requests: write
47+
concurrency:
48+
group: release-plz-${{ github.ref }}
49+
cancel-in-progress: false
50+
steps:
51+
- *checkout
52+
- *install-rust
53+
- name: Run release-plz
54+
uses: release-plz/[email protected]
55+
with:
56+
command: release-pr
2557
env:
2658
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
59+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)