|
1 |
| -name: Release Plz |
| 1 | +name: Release-plz |
2 | 2 |
|
3 |
| -permissions: {} |
| 3 | +permissions: |
| 4 | + pull-requests: write |
| 5 | + contents: write |
4 | 6 |
|
5 | 7 | on:
|
6 |
| - workflow_dispatch: |
7 | 8 | push:
|
8 | 9 | branches:
|
9 | 10 | - main
|
10 | 11 |
|
11 |
| -concurrency: |
12 |
| - group: ${{ github.workflow }}-${{ github.ref }} |
13 |
| - cancel-in-progress: true |
14 |
| - |
15 | 12 | jobs:
|
16 |
| - release-plz: |
| 13 | + # Release unpublished packages. |
| 14 | + release-plz-release: |
| 15 | + name: Release-plz release |
17 | 16 | runs-on: ubuntu-latest
|
| 17 | + if: ${{ github.repository_owner == 'napi-rs' }} |
18 | 18 | permissions:
|
19 | 19 | contents: write
|
20 |
| - pull-requests: write |
| 20 | + id-token: write |
21 | 21 | steps:
|
22 |
| - - uses: actions/checkout@v4 |
| 22 | + - name: Checkout repository |
| 23 | + uses: actions/checkout@v4 |
23 | 24 | with:
|
24 | 25 | fetch-depth: 0
|
25 | 26 | submodules: recursive
|
| 27 | + - name: Install Rust toolchain |
| 28 | + uses: dtolnay/rust-toolchain@stable |
| 29 | + - uses: rust-lang/crates-io-auth-action@v1 |
| 30 | + id: auth |
| 31 | + - name: Run release-plz |
| 32 | + uses: release-plz/[email protected] |
| 33 | + with: |
| 34 | + command: release |
| 35 | + env: |
| 36 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |
26 | 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 == 'napi-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 | + - name: Checkout repository |
| 52 | + uses: actions/checkout@v4 |
| 53 | + with: |
| 54 | + fetch-depth: 0 |
| 55 | + submodules: recursive |
| 56 | + - name: Install Rust toolchain |
| 57 | + uses: dtolnay/rust-toolchain@stable |
27 | 58 | - name: Run release-plz
|
28 |
| - id: release-plz |
29 | 59 | uses: release-plz/[email protected]
|
| 60 | + with: |
| 61 | + command: release-pr |
30 | 62 | env:
|
31 | 63 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
32 |
| - CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }} |
|
0 commit comments