1
- # This file was autogenerated by cargo- dist: https://opensource.axo.dev/cargo-dist/
1
+ # This file was autogenerated by dist: https://opensource.axo.dev/cargo-dist/
2
2
#
3
3
# Copyright 2022-2024, axodotdev
4
4
# SPDX-License-Identifier: MIT or Apache-2.0
5
5
#
6
6
# CI that:
7
7
#
8
8
# * checks for a Git Tag that looks like a release
9
- # * builds artifacts with cargo- dist (archives, installers, hashes)
9
+ # * builds artifacts with dist (archives, installers, hashes)
10
10
# * uploads those artifacts to temporary workflow zip
11
11
# * on success, uploads the artifacts to a GitHub Release
12
12
#
@@ -24,10 +24,10 @@ permissions:
24
24
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
25
25
#
26
26
# If PACKAGE_NAME is specified, then the announcement will be for that
27
- # 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).
28
28
#
29
29
# If PACKAGE_NAME isn't specified, then the announcement will be for all
30
- # (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
31
31
# intended for workspaces with only one dist-able package, or with all dist-able
32
32
# packages versioned/released in lockstep).
33
33
#
45
45
- ' synd-term-v[0-9]+.[0-9]+.[0-9]+*' # DIRTY_FOR_SYND
46
46
47
47
jobs :
48
- # 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
49
49
plan :
50
50
runs-on : " ubuntu-20.04"
51
51
outputs :
@@ -59,25 +59,25 @@ jobs:
59
59
- uses : actions/checkout@v4
60
60
with :
61
61
submodules : recursive
62
- - name : Install cargo- dist
62
+ - name : Install dist
63
63
# we specify bash to get pipefail; it guards against the `curl` command
64
64
# failing. otherwise `sh` won't catch that `curl` returned non-0
65
65
shell : bash
66
- run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21.1 /cargo-dist-installer.sh | sh"
67
- - name : Cache cargo- dist
66
+ run : " curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.28.0 /cargo-dist-installer.sh | sh"
67
+ - name : Cache dist
68
68
uses : actions/upload-artifact@v4
69
69
with :
70
70
name : cargo-dist-cache
71
- path : ~/.cargo/bin/cargo- dist
71
+ path : ~/.cargo/bin/dist
72
72
# sure would be cool if github gave us proper conditionals...
73
73
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
74
74
# functionality based on whether this is a pull_request, and whether it's from a fork.
75
75
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
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)) || 'plan' }} --output-format=json > plan-dist-manifest.json
80
- 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"
81
81
cat plan-dist-manifest.json
82
82
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
83
83
- name : " Upload dist-manifest.json"
@@ -95,18 +95,19 @@ jobs:
95
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') }}
96
96
strategy :
97
97
fail-fast : false
98
- # Target platforms/runners are computed by cargo- dist in create-release.
98
+ # Target platforms/runners are computed by dist in create-release.
99
99
# Each member of the matrix has the following arguments:
100
100
#
101
101
# - runner: the github runner
102
- # - dist-args: cli flags to pass to cargo dist
103
- # - 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
104
104
#
105
105
# Typically there will be:
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
109
runs-on : ${{ matrix.runner }}
110
+ container : ${{ matrix.container && matrix.container.image || null }}
110
111
env :
111
112
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
112
113
BUILD_MANIFEST_NAME : target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
@@ -118,8 +119,15 @@ jobs:
118
119
- uses : actions/checkout@v4
119
120
with :
120
121
submodules : recursive
121
- - name : Install cargo-dist
122
- run : ${{ matrix.install_dist }}
122
+ - name : Install Rust non-interactively if not already installed
123
+ if : ${{ matrix.container }}
124
+ run : |
125
+ if ! command -v cargo > /dev/null 2>&1; then
126
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
127
+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
128
+ fi
129
+ - name : Install dist
130
+ run : ${{ matrix.install_dist.run }}
123
131
# Get the dist-manifest
124
132
- name : Fetch local artifacts
125
133
uses : actions/download-artifact@v4
@@ -133,8 +141,8 @@ jobs:
133
141
- name : Build artifacts
134
142
run : |
135
143
# Actually do builds and make zips and whatnot
136
- cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
137
- echo "cargo dist ran successfully"
144
+ dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
145
+ echo "dist ran successfully"
138
146
- id : cargo-dist
139
147
name : Post-build
140
148
# We force bash here just because github makes it really hard to get values up
@@ -144,7 +152,7 @@ jobs:
144
152
run : |
145
153
# Parse out what we just built and upload it to scratch storage
146
154
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
147
- jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
155
+ dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
148
156
echo "EOF" >> "$GITHUB_OUTPUT"
149
157
150
158
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -165,16 +173,17 @@ jobs:
165
173
env :
166
174
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
167
175
BUILD_MANIFEST_NAME : target/distrib/global-dist-manifest.json
176
+ RUSTFLAGS : " --cfg tokio_unstable" # DIRTY_FOR_SYND
168
177
steps :
169
178
- uses : actions/checkout@v4
170
179
with :
171
180
submodules : recursive
172
- - name : Install cached cargo- dist
181
+ - name : Install cached dist
173
182
uses : actions/download-artifact@v4
174
183
with :
175
184
name : cargo-dist-cache
176
185
path : ~/.cargo/bin/
177
- - run : chmod +x ~/.cargo/bin/cargo- dist
186
+ - run : chmod +x ~/.cargo/bin/dist
178
187
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
179
188
- name : Fetch local artifacts
180
189
uses : actions/download-artifact@v4
@@ -185,8 +194,8 @@ jobs:
185
194
- id : cargo-dist
186
195
shell : bash
187
196
run : |
188
- cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
189
- 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"
190
199
191
200
# Parse out what we just built and upload it to scratch storage
192
201
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@@ -218,12 +227,12 @@ jobs:
218
227
- uses : actions/checkout@v4
219
228
with :
220
229
submodules : recursive
221
- - name : Install cached cargo- dist
230
+ - name : Install cached dist
222
231
uses : actions/download-artifact@v4
223
232
with :
224
233
name : cargo-dist-cache
225
234
path : ~/.cargo/bin/
226
- - run : chmod +x ~/.cargo/bin/cargo- dist
235
+ - run : chmod +x ~/.cargo/bin/dist
227
236
# Fetch artifacts from scratch-storage
228
237
- name : Fetch artifacts
229
238
uses : actions/download-artifact@v4
@@ -234,7 +243,7 @@ jobs:
234
243
- id : host
235
244
shell : bash
236
245
run : |
237
- 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
238
247
echo "artifacts uploaded and released successfully"
239
248
cat dist-manifest.json
240
249
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
@@ -302,6 +311,11 @@ jobs:
302
311
name=$(echo "$filename" | sed "s/\.rb$//")
303
312
version=$(echo "$release" | jq .app_version --raw-output)
304
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
+
305
319
git add "Formula/${filename}"
306
320
git commit -m "${name} ${version}"
307
321
done
0 commit comments