-
Notifications
You must be signed in to change notification settings - Fork 5
130 lines (111 loc) · 3.5 KB
/
Copy pathrelease-plz.yml
File metadata and controls
130 lines (111 loc) · 3.5 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Release-plz
on:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
# Publishing mutates crates.io and GitHub release state. Serialize master
# updates, but never cancel a publication after it has started.
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
jobs:
release-plz-release:
name: Publish crate and create GitHub release
if: github.repository == 'ScriptedAlchemy/tracedecay'
runs-on: ubuntu-latest
environment: crates-io
permissions:
contents: write
pull-requests: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: dashboard/package-lock.json
- name: Build dashboard assets
working-directory: dashboard
run: |
npm ci
npm run build
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/setup-linux-mold
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-release-plz-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-plz-release-
${{ runner.os }}-cargo-
- name: Run release-plz release
id: release
uses: release-plz/action@v0.5
continue-on-error: true
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
- name: Retry release-plz release after transient GitHub API failure
id: release_retry
if: steps.release.outcome == 'failure'
uses: release-plz/action@v0.5
continue-on-error: true
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
- name: Fail when release-plz release still fails
if: steps.release.outcome == 'failure' && steps.release_retry.outcome == 'failure'
run: exit 1
- name: Check release version drift
if: always()
run: scripts/check-release-drift.sh
release-plz-pr:
name: Open or update release PR
if: github.repository == 'ScriptedAlchemy/tracedecay'
needs: release-plz-release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/setup-linux-mold
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-release-plz-pr-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-plz-pr-
${{ runner.os }}-cargo-
- name: Run release-plz release-pr
uses: release-plz/action@v0.5
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}