88
88
- x86_64-pc-windows-gnu
89
89
- i686-pc-windows-msvc
90
90
- aarch64-pc-windows-msvc
91
+ # When changing these features, make the same change in build-macos-universal2-release.
91
92
feature : [ small, lean, max, max-pure ]
92
93
include :
93
94
- target : x86_64-unknown-linux-musl
@@ -231,6 +232,7 @@ jobs:
231
232
232
233
strategy :
233
234
matrix :
235
+ # These features need to be exactly the same as the features in build-release.
234
236
feature : [ small, lean, max, max-pure ]
235
237
236
238
env :
@@ -247,7 +249,7 @@ jobs:
247
249
248
250
- name : Obtain single-architecture releases
249
251
run : |
250
- gh release --repo "$REPOSITORY" download "$VERSION" --pattern="$(name aarch64).tar.gz" --pattern="$(name x86_64).tar.gz"
252
+ gh release --repo= "$REPOSITORY" download "$VERSION" --pattern="$(name aarch64).tar.gz" --pattern="$(name x86_64).tar.gz"
251
253
env :
252
254
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
253
255
@@ -274,6 +276,49 @@ jobs:
274
276
echo "ASSET=$(name universal).tar.gz" >> "$GITHUB_ENV"
275
277
276
278
- name : Upload release archive
277
- run : gh release --repo "$REPOSITORY" upload "$VERSION" "$ASSET"
279
+ run : gh release --repo="$REPOSITORY" upload "$VERSION" "$ASSET"
280
+ env :
281
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
282
+
283
+ # This checks and publishes the release on GitHub. It does not upload to crates.io.
284
+ publish-release :
285
+ name : publish-release
286
+
287
+ runs-on : ubuntu-latest
288
+
289
+ needs : [ create-release, build-release, build-macos-universal2-release ]
290
+
291
+ env :
292
+ REPOSITORY : ${{ github.repository }}
293
+ VERSION : ${{ needs.create-release.outputs.version }}
294
+
295
+ steps :
296
+ - name : Discover assets
297
+ run : |
298
+ gh release --repo="$REPOSITORY" view "$VERSION" --json assets --jq '.assets.[].name' > assets.txt
299
+ env :
300
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
301
+
302
+ - name : Show all asset names
303
+ run : cat assets.txt
304
+
305
+ # The `features` array is repeated because GHA doen't support YAML anchors.
306
+ # We will check that the macOS `universal` features match the others exactly.
307
+ # In the future this and the next step may be removed, or expanded to do more validation.
308
+ - name : Extract macOS asset names by architecture
309
+ run : |
310
+ for arch in aarch64 x86_64 universal; do
311
+ grep -Fw "$arch-apple-darwin" assets.txt | sort | tee -- "$arch.txt"
312
+ done
313
+
314
+ - name : Check macOS archive features
315
+ run : |
316
+ mask() { sed -r 's/\w+-apple-darwin/<arch>-apple-darwin/' -- "$1.txt"; }
317
+ diff -- <(mask aarch64) <(mask universal)
318
+ diff -- <(mask x86_64) <(mask universal)
319
+
320
+ - name : Publish the release
321
+ if : false
322
+ run : gh release --repo="$REPOSITORY" edit "$VERSION" --draft=false
278
323
env :
279
324
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments