|
7 | 7 | - main
|
8 | 8 |
|
9 | 9 | jobs:
|
| 10 | + release-plz-pr: |
| 11 | + name: Create release-plz PR |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + # Ensure only one release-plz tries to create a PR at a time. |
| 15 | + # |
| 16 | + # If two instances update the PR simultaneously, one will see an outdated git ref |
| 17 | + # and end up recreating the PR unnecessarily. |
| 18 | + concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.ref }}-pr |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout repository |
| 24 | + uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + fetch-depth: 0 |
| 27 | + token: ${{ secrets.HUGRBOT_PAT }} |
| 28 | + - name: Install Rust toolchain |
| 29 | + uses: dtolnay/rust-toolchain@stable |
| 30 | + |
| 31 | + - name: Create release PR |
| 32 | + uses: MarcoIeni/release-plz-action@v0.5 |
| 33 | + env: |
| 34 | + GITHUB_TOKEN: ${{ secrets.HUGRBOT_PAT }} |
| 35 | + with: |
| 36 | + command: release-pr |
| 37 | + |
| 38 | + # This job triggers the release to crates.io if the current crate version is higher than the |
| 39 | + # ones in the registry. |
| 40 | + # |
| 41 | + # Release-plz will only run on commits originating from a PR whose source branch started with |
| 42 | + # `release-plz-` (see `release-always=false` in the config). |
10 | 43 | release-plz:
|
11 |
| - name: Release-plz |
| 44 | + name: Release the crates |
12 | 45 | runs-on: ubuntu-latest
|
| 46 | + environment: crate-release |
| 47 | + permissions: |
| 48 | + id-token: write # Required for OIDC token exchange |
13 | 49 | steps:
|
14 | 50 | - name: Checkout repository
|
15 | 51 | uses: actions/checkout@v4
|
|
18 | 54 | token: ${{ secrets.HUGRBOT_PAT }}
|
19 | 55 | - name: Install Rust toolchain
|
20 | 56 | uses: dtolnay/rust-toolchain@stable
|
| 57 | + |
| 58 | + - uses: rust-lang/crates-io-auth-action@v1 |
| 59 | + id: auth |
| 60 | + |
21 | 61 | - name: Run release-plz
|
22 | 62 | uses: MarcoIeni/release-plz-action@v0.5
|
23 | 63 | env:
|
24 |
| - GITHUB_TOKEN: ${{ secrets.HUGRBOT_PAT }} |
25 |
| - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
| 64 | + GITHUB_TOKEN: ${{ secrets.HUGRBOT_PAT }} |
| 65 | + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |
| 66 | + with: |
| 67 | + command: release |
0 commit comments