1
- # Copyright 2022-2023 , axodotdev
1
+ # Copyright 2022-2024 , axodotdev
2
2
# SPDX-License-Identifier: MIT or Apache-2.0
3
3
#
4
4
# CI that:
5
5
#
6
6
# * checks for a Git Tag that looks like a release
7
7
# * builds artifacts with cargo-dist (archives, installers, hashes)
8
8
# * uploads those artifacts to temporary workflow zip
9
- # * on success, uploads the artifacts to a Github Release
9
+ # * on success, uploads the artifacts to a GitHub Release
10
10
#
11
- # Note that the Github Release will be created with a generated
11
+ # Note that the GitHub Release will be created with a generated
12
12
# title/body based on your changelogs.
13
13
14
14
name : Release
@@ -31,7 +31,7 @@ permissions:
31
31
# packages versioned/released in lockstep).
32
32
#
33
33
# If you push multiple tags at once, separate instances of this workflow will
34
- # spin up, creating an independent announcement for each one. However Github
34
+ # spin up, creating an independent announcement for each one. However, GitHub
35
35
# will hard limit this to 3 tags per commit, as it will assume more tags is a
36
36
# mistake.
37
37
#
@@ -76,15 +76,15 @@ jobs:
76
76
# but also really annoying to build CI around when it needs secrets to work right.)
77
77
- id : plan
78
78
run : |
79
- cargo dist ${{ !github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name) || (github.event.pull_request.head.repo.fork && 'plan' || 'host --steps=check') }} --output-format=json > dist-manifest.json
79
+ cargo dist ${{ ( !github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan- dist-manifest.json
80
80
echo "cargo dist ran successfully"
81
- cat dist-manifest.json
82
- echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
81
+ cat plan- dist-manifest.json
82
+ echo "manifest=$(jq -c "." plan- dist-manifest.json)" >> "$GITHUB_OUTPUT"
83
83
- name : " Upload dist-manifest.json"
84
- uses : actions/upload-artifact@v3
84
+ uses : actions/upload-artifact@v4
85
85
with :
86
- name : artifacts
87
- path : dist-manifest.json
86
+ name : artifacts-plan-dist-manifest
87
+ path : plan- dist-manifest.json
88
88
89
89
# Build and packages all the platform-specific things
90
90
build-local-artifacts :
@@ -106,23 +106,24 @@ jobs:
106
106
# - 1 "global" task that builds universal installers
107
107
# - N "local" tasks that build each platform's binaries and platform-specific installers
108
108
matrix : ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
109
- # runs-on: ${{ matrix.runner }}
110
- runs-on : arc -runner-set
109
+ # runs-on: ${{ matrix.runner }}
110
+ runs-on : release -runner
111
111
env :
112
112
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
113
113
BUILD_MANIFEST_NAME : target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
114
114
steps :
115
+ - name : enable windows longpaths
116
+ run : |
117
+ git config --global core.longpaths true
115
118
- uses : actions/checkout@v4
116
119
with :
117
120
submodules : recursive
118
-
119
- - name : Install toolchain
120
- uses : dtolnay/rust-toolchain@nightly
121
+ - uses : swatinem/rust-cache@v2
121
122
with :
122
- toolchain : stable
123
+ key : ${{ join(matrix.targets, '-') }}
123
124
124
- - uses : Swatinem/rust-cache@v2
125
- - run : |
125
+ - name : Install dependencies
126
+ run : |
126
127
sudo apt-get update
127
128
sudo apt-get install --assume-yes jq pkg-config git clang curl libssl-dev llvm libudev-dev make protobuf-compiler
128
129
rustup install nightly
@@ -134,10 +135,11 @@ jobs:
134
135
run : ${{ matrix.install_dist }}
135
136
# Get the dist-manifest
136
137
- name : Fetch local artifacts
137
- uses : actions/download-artifact@v3
138
+ uses : actions/download-artifact@v4
138
139
with :
139
- name : artifacts
140
+ pattern : artifacts-*
140
141
path : target/distrib/
142
+ merge-multiple : true
141
143
- name : Install dependencies
142
144
run : |
143
145
${{ matrix.packages_install }}
@@ -155,14 +157,14 @@ jobs:
155
157
run : |
156
158
# Parse out what we just built and upload it to scratch storage
157
159
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
158
- jq --raw-output ".artifacts[]?.path | select( . != null ) " dist-manifest.json >> "$GITHUB_OUTPUT"
160
+ jq --raw-output ".upload_files[] " dist-manifest.json >> "$GITHUB_OUTPUT"
159
161
echo "EOF" >> "$GITHUB_OUTPUT"
160
162
161
163
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
162
164
- name : " Upload artifacts"
163
- uses : actions/upload-artifact@v3
165
+ uses : actions/upload-artifact@v4
164
166
with :
165
- name : artifacts
167
+ name : artifacts-build-local-${{ join(matrix.targets, '_') }}
166
168
path : |
167
169
${{ steps.cargo-dist.outputs.paths }}
168
170
${{ env.BUILD_MANIFEST_NAME }}
@@ -181,13 +183,15 @@ jobs:
181
183
with :
182
184
submodules : recursive
183
185
- name : Install cargo-dist
186
+ shell : bash
184
187
run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.14.1/cargo-dist-installer.sh | sh"
185
188
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
186
189
- name : Fetch local artifacts
187
- uses : actions/download-artifact@v3
190
+ uses : actions/download-artifact@v4
188
191
with :
189
- name : artifacts
192
+ pattern : artifacts-*
190
193
path : target/distrib/
194
+ merge-multiple : true
191
195
- id : cargo-dist
192
196
shell : bash
193
197
run : |
@@ -196,14 +200,14 @@ jobs:
196
200
197
201
# Parse out what we just built and upload it to scratch storage
198
202
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
199
- jq --raw-output ".artifacts[]?.path | select( . != null ) " dist-manifest.json >> "$GITHUB_OUTPUT"
203
+ jq --raw-output ".upload_files[] " dist-manifest.json >> "$GITHUB_OUTPUT"
200
204
echo "EOF" >> "$GITHUB_OUTPUT"
201
205
202
206
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
203
207
- name : " Upload artifacts"
204
- uses : actions/upload-artifact@v3
208
+ uses : actions/upload-artifact@v4
205
209
with :
206
- name : artifacts
210
+ name : artifacts-build-global
207
211
path : |
208
212
${{ steps.cargo-dist.outputs.paths }}
209
213
${{ env.BUILD_MANIFEST_NAME }}
@@ -228,11 +232,12 @@ jobs:
228
232
run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.14.1/cargo-dist-installer.sh | sh"
229
233
# Fetch artifacts from scratch-storage
230
234
- name : Fetch artifacts
231
- uses : actions/download-artifact@v3
235
+ uses : actions/download-artifact@v4
232
236
with :
233
- name : artifacts
237
+ pattern : artifacts-*
234
238
path : target/distrib/
235
- # This is a harmless no-op for Github Releases, hosting for that happens in "announce"
239
+ merge-multiple : true
240
+ # This is a harmless no-op for GitHub Releases, hosting for that happens in "announce"
236
241
- id : host
237
242
shell : bash
238
243
run : |
@@ -241,12 +246,13 @@ jobs:
241
246
cat dist-manifest.json
242
247
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
243
248
- name : " Upload dist-manifest.json"
244
- uses : actions/upload-artifact@v3
249
+ uses : actions/upload-artifact@v4
245
250
with :
246
- name : artifacts
251
+ # Overwrite the previous copy
252
+ name : artifacts-dist-manifest
247
253
path : dist-manifest.json
248
254
249
- # Create a Github Release while uploading all files to it
255
+ # Create a GitHub Release while uploading all files to it
250
256
announce :
251
257
needs :
252
258
- plan
@@ -262,16 +268,17 @@ jobs:
262
268
- uses : actions/checkout@v4
263
269
with :
264
270
submodules : recursive
265
- - name : " Download Github Artifacts"
266
- uses : actions/download-artifact@v3
271
+ - name : " Download GitHub Artifacts"
272
+ uses : actions/download-artifact@v4
267
273
with :
268
- name : artifacts
274
+ pattern : artifacts-*
269
275
path : artifacts
276
+ merge-multiple : true
270
277
- name : Cleanup
271
278
run : |
272
279
# Remove the granular manifests
273
280
rm -f artifacts/*-dist-manifest.json
274
- - name : Create Github Release
281
+ - name : Create GitHub Release
275
282
uses : ncipollo/release-action@v1
276
283
with :
277
284
tag : ${{ needs.plan.outputs.tag }}
0 commit comments