1
- # This file was autogenerated by dist: https://opensource.axo.dev/cargo-dist/
2
- #
3
1
# Copyright 2022-2024, axodotdev
4
2
# SPDX-License-Identifier: MIT or Apache-2.0
5
3
#
6
4
# CI that:
7
5
#
8
6
# * checks for a Git Tag that looks like a release
9
- # * builds artifacts with dist (archives, installers, hashes)
7
+ # * builds artifacts with cargo- dist (archives, installers, hashes)
10
8
# * uploads those artifacts to temporary workflow zip
11
9
# * on success, uploads the artifacts to a GitHub Release
12
10
#
@@ -26,10 +24,10 @@ permissions:
26
24
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
27
25
#
28
26
# If PACKAGE_NAME is specified, then the announcement will be for that
29
- # package (erroring out if it doesn't have the given version or isn't dist-able).
27
+ # package (erroring out if it doesn't have the given version or isn't cargo- dist-able).
30
28
#
31
29
# If PACKAGE_NAME isn't specified, then the announcement will be for all
32
- # (dist-able) packages in the workspace with that version (this mode is
30
+ # (cargo- dist-able) packages in the workspace with that version (this mode is
33
31
# intended for workspaces with only one dist-able package, or with all dist-able
34
32
# packages versioned/released in lockstep).
35
33
#
47
45
- ' **[0-9]+.[0-9]+.[0-9]+*'
48
46
49
47
jobs :
50
- # Run 'dist plan' (or host) to determine what tasks we need to do
48
+ # Run 'cargo dist plan' (or host) to determine what tasks we need to do
51
49
plan :
52
50
runs-on : " ubuntu-20.04"
53
51
outputs :
@@ -61,25 +59,25 @@ jobs:
61
59
- uses : actions/checkout@v4
62
60
with :
63
61
submodules : recursive
64
- - name : Install dist
62
+ - name : Install cargo- dist
65
63
# we specify bash to get pipefail; it guards against the `curl` command
66
64
# failing. otherwise `sh` won't catch that `curl` returned non-0
67
65
shell : bash
68
- run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.28 .0/cargo-dist-installer.sh | sh"
69
- - name : Cache dist
66
+ run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21 .0/cargo-dist-installer.sh | sh"
67
+ - name : Cache cargo- dist
70
68
uses : actions/upload-artifact@v4
71
69
with :
72
70
name : cargo-dist-cache
73
- path : ~/.cargo/bin/dist
71
+ path : ~/.cargo/bin/cargo- dist
74
72
# sure would be cool if github gave us proper conditionals...
75
73
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
76
74
# functionality based on whether this is a pull_request, and whether it's from a fork.
77
75
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
78
76
# but also really annoying to build CI around when it needs secrets to work right.)
79
77
- id : plan
80
78
run : |
81
- dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
82
- echo "dist ran successfully"
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
+ echo "cargo dist ran successfully"
83
81
cat plan-dist-manifest.json
84
82
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
85
83
- name : " Upload dist-manifest.json"
@@ -97,19 +95,18 @@ jobs:
97
95
if : ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
98
96
strategy :
99
97
fail-fast : false
100
- # Target platforms/runners are computed by dist in create-release.
98
+ # Target platforms/runners are computed by cargo- dist in create-release.
101
99
# Each member of the matrix has the following arguments:
102
100
#
103
101
# - runner: the github runner
104
- # - dist-args: cli flags to pass to dist
105
- # - install-dist: expression to run to install dist on the runner
102
+ # - dist-args: cli flags to pass to cargo dist
103
+ # - install-dist: expression to run to install cargo- dist on the runner
106
104
#
107
105
# Typically there will be:
108
106
# - 1 "global" task that builds universal installers
109
107
# - N "local" tasks that build each platform's binaries and platform-specific installers
110
108
matrix : ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
111
109
runs-on : ${{ matrix.runner }}
112
- container : ${{ matrix.container && matrix.container.image || null }}
113
110
env :
114
111
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
115
112
BUILD_MANIFEST_NAME : target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
@@ -120,15 +117,8 @@ jobs:
120
117
- uses : actions/checkout@v4
121
118
with :
122
119
submodules : recursive
123
- - name : Install Rust non-interactively if not already installed
124
- if : ${{ matrix.container }}
125
- run : |
126
- if ! command -v cargo > /dev/null 2>&1; then
127
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
128
- echo "$HOME/.cargo/bin" >> $GITHUB_PATH
129
- fi
130
- - name : Install dist
131
- run : ${{ matrix.install_dist.run }}
120
+ - name : Install cargo-dist
121
+ run : ${{ matrix.install_dist }}
132
122
# Get the dist-manifest
133
123
- name : Fetch local artifacts
134
124
uses : actions/download-artifact@v4
@@ -142,8 +132,8 @@ jobs:
142
132
- name : Build artifacts
143
133
run : |
144
134
# Actually do builds and make zips and whatnot
145
- dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
146
- echo "dist ran successfully"
135
+ cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
136
+ echo "cargo dist ran successfully"
147
137
- name : Attest
148
138
uses : actions/attest-build-provenance@v1
149
139
with :
@@ -157,7 +147,7 @@ jobs:
157
147
run : |
158
148
# Parse out what we just built and upload it to scratch storage
159
149
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
160
- dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
150
+ jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
161
151
echo "EOF" >> "$GITHUB_OUTPUT"
162
152
163
153
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -182,12 +172,12 @@ jobs:
182
172
- uses : actions/checkout@v4
183
173
with :
184
174
submodules : recursive
185
- - name : Install cached dist
175
+ - name : Install cached cargo- dist
186
176
uses : actions/download-artifact@v4
187
177
with :
188
178
name : cargo-dist-cache
189
179
path : ~/.cargo/bin/
190
- - run : chmod +x ~/.cargo/bin/dist
180
+ - run : chmod +x ~/.cargo/bin/cargo- dist
191
181
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
192
182
- name : Fetch local artifacts
193
183
uses : actions/download-artifact@v4
@@ -198,8 +188,8 @@ jobs:
198
188
- id : cargo-dist
199
189
shell : bash
200
190
run : |
201
- dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
202
- echo "dist ran successfully"
191
+ cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
192
+ echo "cargo dist ran successfully"
203
193
204
194
# Parse out what we just built and upload it to scratch storage
205
195
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@@ -231,12 +221,12 @@ jobs:
231
221
- uses : actions/checkout@v4
232
222
with :
233
223
submodules : recursive
234
- - name : Install cached dist
224
+ - name : Install cached cargo- dist
235
225
uses : actions/download-artifact@v4
236
226
with :
237
227
name : cargo-dist-cache
238
228
path : ~/.cargo/bin/
239
- - run : chmod +x ~/.cargo/bin/dist
229
+ - run : chmod +x ~/.cargo/bin/cargo- dist
240
230
# Fetch artifacts from scratch-storage
241
231
- name : Fetch artifacts
242
232
uses : actions/download-artifact@v4
@@ -247,7 +237,7 @@ jobs:
247
237
- id : host
248
238
shell : bash
249
239
run : |
250
- dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
240
+ cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
251
241
echo "artifacts uploaded and released successfully"
252
242
cat dist-manifest.json
253
243
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
0 commit comments