1
- # Copyright 2022-2024, axodotdev
1
+ # This file was autogenerated by dist: https://github.com/astral-sh/cargo-dist
2
+ #
3
+ # Copyright 2025 Astral Software Inc.
2
4
# SPDX-License-Identifier: MIT or Apache-2.0
3
5
#
4
6
# CI that:
5
7
#
6
8
# * checks for a Git Tag that looks like a release
7
- # * builds artifacts with cargo- dist (archives, installers, hashes)
9
+ # * builds artifacts with dist (archives, installers, hashes)
8
10
# * uploads those artifacts to temporary workflow zip
9
11
# * on success, uploads the artifacts to a GitHub Release
10
12
#
@@ -22,10 +24,10 @@ permissions:
22
24
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
23
25
#
24
26
# If PACKAGE_NAME is specified, then the announcement will be for that
25
- # package (erroring out if it doesn't have the given version or isn't cargo- dist-able).
27
+ # package (erroring out if it doesn't have the given version or isn't dist-able).
26
28
#
27
29
# If PACKAGE_NAME isn't specified, then the announcement will be for all
28
- # (cargo- dist-able) packages in the workspace with that version (this mode is
30
+ # (dist-able) packages in the workspace with that version (this mode is
29
31
# intended for workspaces with only one dist-able package, or with all dist-able
30
32
# packages versioned/released in lockstep).
31
33
#
43
45
- ' libsql-server**[0-9]+.[0-9]+.[0-9]+*'
44
46
45
47
jobs :
46
- # Run 'cargo dist plan' (or host) to determine what tasks we need to do
48
+ # Run 'dist plan' (or host) to determine what tasks we need to do
47
49
plan :
48
- runs-on : " ubuntu-20 .04"
50
+ runs-on : " ubuntu-22 .04"
49
51
outputs :
50
52
val : ${{ steps.plan.outputs.manifest }}
51
53
tag : ${{ !github.event.pull_request && github.ref_name || '' }}
@@ -57,25 +59,25 @@ jobs:
57
59
- uses : actions/checkout@v4
58
60
with :
59
61
submodules : recursive
60
- - name : Install cargo- dist
62
+ - name : Install dist
61
63
# we specify bash to get pipefail; it guards against the `curl` command
62
64
# failing. otherwise `sh` won't catch that `curl` returned non-0
63
65
shell : bash
64
- run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev /cargo-dist/releases/download/v0.21.0 /cargo-dist-installer.sh | sh"
65
- - name : Cache cargo- dist
66
+ run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh /cargo-dist/releases/download/v0.28.3 /cargo-dist-installer.sh | sh"
67
+ - name : Cache dist
66
68
uses : actions/upload-artifact@v4
67
69
with :
68
70
name : cargo-dist-cache
69
- path : ~/.cargo/bin/cargo- dist
71
+ path : ~/.cargo/bin/dist
70
72
# sure would be cool if github gave us proper conditionals...
71
73
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
72
74
# functionality based on whether this is a pull_request, and whether it's from a fork.
73
75
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
74
76
# but also really annoying to build CI around when it needs secrets to work right.)
75
77
- id : plan
76
78
run : |
77
- cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
78
- echo "cargo dist ran successfully"
79
+ dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
80
+ echo "dist ran successfully"
79
81
cat plan-dist-manifest.json
80
82
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
81
83
- name : " Upload dist-manifest.json"
@@ -93,18 +95,19 @@ jobs:
93
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') }}
94
96
strategy :
95
97
fail-fast : false
96
- # Target platforms/runners are computed by cargo- dist in create-release.
98
+ # Target platforms/runners are computed by dist in create-release.
97
99
# Each member of the matrix has the following arguments:
98
100
#
99
101
# - runner: the github runner
100
- # - dist-args: cli flags to pass to cargo dist
101
- # - install-dist: expression to run to install cargo- dist on the runner
102
+ # - dist-args: cli flags to pass to dist
103
+ # - install-dist: expression to run to install dist on the runner
102
104
#
103
105
# Typically there will be:
104
106
# - 1 "global" task that builds universal installers
105
107
# - N "local" tasks that build each platform's binaries and platform-specific installers
106
108
matrix : ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
107
109
runs-on : ${{ matrix.runner }}
110
+ container : ${{ matrix.container && matrix.container.image || null }}
108
111
env :
109
112
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
110
113
BUILD_MANIFEST_NAME : target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
@@ -115,10 +118,17 @@ jobs:
115
118
- uses : actions/checkout@v4
116
119
with :
117
120
submodules : recursive
121
+ - name : Install Rust non-interactively if not already installed
122
+ if : ${{ matrix.container }}
123
+ run : |
124
+ if ! command -v cargo > /dev/null 2>&1; then
125
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
126
+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
127
+ fi
118
128
- name : " Prepare env vars"
119
129
run : " echo \" RUSTFLAGS=--cfg tokio_unstable\" >> $GITHUB_ENV"
120
- - name : Install cargo- dist
121
- run : ${{ matrix.install_dist }}
130
+ - name : Install dist
131
+ run : ${{ matrix.install_dist.run }}
122
132
# Get the dist-manifest
123
133
- name : Fetch local artifacts
124
134
uses : actions/download-artifact@v4
@@ -132,8 +142,8 @@ jobs:
132
142
- name : Build artifacts
133
143
run : |
134
144
# Actually do builds and make zips and whatnot
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"
145
+ dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
146
+ echo "dist ran successfully"
137
147
- id : cargo-dist
138
148
name : Post-build
139
149
# We force bash here just because github makes it really hard to get values up
@@ -143,7 +153,7 @@ jobs:
143
153
run : |
144
154
# Parse out what we just built and upload it to scratch storage
145
155
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
146
- jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
156
+ dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
147
157
echo "EOF" >> "$GITHUB_OUTPUT"
148
158
149
159
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -160,20 +170,20 @@ jobs:
160
170
needs :
161
171
- plan
162
172
- build-local-artifacts
163
- runs-on : " ubuntu-20 .04"
173
+ runs-on : " ubuntu-22 .04"
164
174
env :
165
175
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
166
176
BUILD_MANIFEST_NAME : target/distrib/global-dist-manifest.json
167
177
steps :
168
178
- uses : actions/checkout@v4
169
179
with :
170
180
submodules : recursive
171
- - name : Install cached cargo- dist
181
+ - name : Install cached dist
172
182
uses : actions/download-artifact@v4
173
183
with :
174
184
name : cargo-dist-cache
175
185
path : ~/.cargo/bin/
176
- - run : chmod +x ~/.cargo/bin/cargo- dist
186
+ - run : chmod +x ~/.cargo/bin/dist
177
187
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
178
188
- name : Fetch local artifacts
179
189
uses : actions/download-artifact@v4
@@ -184,8 +194,8 @@ jobs:
184
194
- id : cargo-dist
185
195
shell : bash
186
196
run : |
187
- cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
188
- echo "cargo dist ran successfully"
197
+ dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
198
+ echo "dist ran successfully"
189
199
190
200
# Parse out what we just built and upload it to scratch storage
191
201
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@@ -210,19 +220,19 @@ jobs:
210
220
if : ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
211
221
env :
212
222
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
213
- runs-on : " ubuntu-20 .04"
223
+ runs-on : " ubuntu-22 .04"
214
224
outputs :
215
225
val : ${{ steps.host.outputs.manifest }}
216
226
steps :
217
227
- uses : actions/checkout@v4
218
228
with :
219
229
submodules : recursive
220
- - name : Install cached cargo- dist
230
+ - name : Install cached dist
221
231
uses : actions/download-artifact@v4
222
232
with :
223
233
name : cargo-dist-cache
224
234
path : ~/.cargo/bin/
225
- - run : chmod +x ~/.cargo/bin/cargo- dist
235
+ - run : chmod +x ~/.cargo/bin/dist
226
236
# Fetch artifacts from scratch-storage
227
237
- name : Fetch artifacts
228
238
uses : actions/download-artifact@v4
@@ -233,7 +243,7 @@ jobs:
233
243
- id : host
234
244
shell : bash
235
245
run : |
236
- cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
246
+ dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
237
247
echo "artifacts uploaded and released successfully"
238
248
cat dist-manifest.json
239
249
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
@@ -270,7 +280,7 @@ jobs:
270
280
needs :
271
281
- plan
272
282
- host
273
- runs-on : " ubuntu-20 .04"
283
+ runs-on : " ubuntu-22 .04"
274
284
env :
275
285
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
276
286
PLAN : ${{ needs.plan.outputs.val }}
@@ -301,6 +311,11 @@ jobs:
301
311
name=$(echo "$filename" | sed "s/\.rb$//")
302
312
version=$(echo "$release" | jq .app_version --raw-output)
303
313
314
+ export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
315
+ brew update
316
+ # We avoid reformatting user-provided data such as the app description and homepage.
317
+ brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
318
+
304
319
git add "Formula/${filename}"
305
320
git commit -m "${name} ${version}"
306
321
done
@@ -315,7 +330,7 @@ jobs:
315
330
# still allowing individual publish jobs to skip themselves (for prereleases).
316
331
# "host" however must run to completion, no skipping allowed!
317
332
if : ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
318
- runs-on : " ubuntu-20 .04"
333
+ runs-on : " ubuntu-22 .04"
319
334
env :
320
335
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
321
336
steps :
0 commit comments