-
Notifications
You must be signed in to change notification settings - Fork 18
81 lines (71 loc) · 2.56 KB
/
Copy pathrelease-plz.yml
File metadata and controls
81 lines (71 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Automatic changelog, version bumping, and semver-checks with release-plz for rust projects
name: Release-plz 🦀
on:
push:
branches:
- main
env:
LLVM_MAIN_VERSION: "21"
LLVM_VERSION: "21.1"
LLVM_FEATURE_NAME: "21-1"
jobs:
release-plz-pr:
name: Create release-plz PR
runs-on: ubuntu-latest
# Ensure only one release-plz tries to create a PR at a time.
#
# If two instances update the PR simultaneously, one will see an outdated git ref
# and end up recreating the PR unnecessarily.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-pr
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
token: ${{ secrets.HUGRBOT_PAT }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Create release PR
uses: MarcoIeni/release-plz-action@v0.5
env:
GITHUB_TOKEN: ${{ secrets.HUGRBOT_PAT }}
with:
command: release-pr
# This job triggers the release to crates.io if the current crate version is higher than the
# ones in the registry.
#
# Release-plz will only run on commits originating from a PR whose source branch started with
# `release-plz-` (see `release-always=false` in the config).
release-plz:
name: Release the crates
runs-on: ubuntu-latest
environment: crate-release
permissions:
id-token: write # Required for OIDC token exchange
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
token: ${{ secrets.HUGRBOT_PAT }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
# These are needed when doing a crate release, since `cargo release`
# checks that the crate can be compiled before publishing it.
- name: Install LLVM and Clang
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${{ env.LLVM_MAIN_VERSION }} main'
sudo apt update
sudo apt install llvm-${{ env.LLVM_MAIN_VERSION }} libpolly-${{ env.LLVM_MAIN_VERSION }}-dev
- uses: rust-lang/crates-io-auth-action@v1
id: auth
- name: Run release-plz
uses: MarcoIeni/release-plz-action@v0.5
env:
GITHUB_TOKEN: ${{ secrets.HUGRBOT_PAT }}
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
with:
command: release