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
#
41
41
push :
42
42
tags :
43
43
- ' **[0-9]+.[0-9]+.[0-9]+*'
44
- pull_request :
45
44
46
45
jobs :
47
46
# Run 'cargo dist plan' (or host) to determine what tasks we need to do
62
61
# we specify bash to get pipefail; it guards against the `curl` command
63
62
# failing. otherwise `sh` won't catch that `curl` returned non-0
64
63
shell : bash
65
- run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.12.0 /cargo-dist-installer.sh | sh"
64
+ run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.2 /cargo-dist-installer.sh | sh"
66
65
# sure would be cool if github gave us proper conditionals...
67
66
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
68
67
# functionality based on whether this is a pull_request, and whether it's from a fork.
@@ -109,6 +108,8 @@ jobs:
109
108
with :
110
109
submodules : recursive
111
110
- uses : swatinem/rust-cache@v2
111
+ with :
112
+ key : ${{ join(matrix.targets, '-') }}
112
113
- name : Install cargo-dist
113
114
run : ${{ matrix.install_dist }}
114
115
# Get the dist-manifest
@@ -135,7 +136,7 @@ jobs:
135
136
run : |
136
137
# Parse out what we just built and upload it to scratch storage
137
138
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
138
- jq --raw-output ".artifacts[]?.path | select( . != null ) " dist-manifest.json >> "$GITHUB_OUTPUT"
139
+ jq --raw-output ".upload_files[] " dist-manifest.json >> "$GITHUB_OUTPUT"
139
140
echo "EOF" >> "$GITHUB_OUTPUT"
140
141
141
142
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -162,7 +163,7 @@ jobs:
162
163
submodules : recursive
163
164
- name : Install cargo-dist
164
165
shell : bash
165
- run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.12.0 /cargo-dist-installer.sh | sh"
166
+ run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.2 /cargo-dist-installer.sh | sh"
166
167
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
167
168
- name : Fetch local artifacts
168
169
uses : actions/download-artifact@v4
@@ -178,7 +179,7 @@ jobs:
178
179
179
180
# Parse out what we just built and upload it to scratch storage
180
181
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
181
- jq --raw-output ".artifacts[]?.path | select( . != null ) " dist-manifest.json >> "$GITHUB_OUTPUT"
182
+ jq --raw-output ".upload_files[] " dist-manifest.json >> "$GITHUB_OUTPUT"
182
183
echo "EOF" >> "$GITHUB_OUTPUT"
183
184
184
185
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -207,15 +208,15 @@ jobs:
207
208
with :
208
209
submodules : recursive
209
210
- name : Install cargo-dist
210
- run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.12.0 /cargo-dist-installer.sh | sh"
211
+ run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.13.2 /cargo-dist-installer.sh | sh"
211
212
# Fetch artifacts from scratch-storage
212
213
- name : Fetch artifacts
213
214
uses : actions/download-artifact@v4
214
215
with :
215
216
pattern : artifacts-*
216
217
path : target/distrib/
217
218
merge-multiple : true
218
- # This is a harmless no-op for Github Releases, hosting for that happens in "announce"
219
+ # This is a harmless no-op for GitHub Releases, hosting for that happens in "announce"
219
220
- id : host
220
221
shell : bash
221
222
run : |
@@ -230,7 +231,7 @@ jobs:
230
231
name : artifacts-dist-manifest
231
232
path : dist-manifest.json
232
233
233
- # Create a Github Release while uploading all files to it
234
+ # Create a GitHub Release while uploading all files to it
234
235
announce :
235
236
needs :
236
237
- plan
@@ -246,7 +247,7 @@ jobs:
246
247
- uses : actions/checkout@v4
247
248
with :
248
249
submodules : recursive
249
- - name : " Download Github Artifacts"
250
+ - name : " Download GitHub Artifacts"
250
251
uses : actions/download-artifact@v4
251
252
with :
252
253
pattern : artifacts-*
@@ -256,7 +257,7 @@ jobs:
256
257
run : |
257
258
# Remove the granular manifests
258
259
rm -f artifacts/*-dist-manifest.json
259
- - name : Create Github Release
260
+ - name : Create GitHub Release
260
261
uses : ncipollo/release-action@v1
261
262
with :
262
263
tag : ${{ needs.plan.outputs.tag }}
0 commit comments