Skip to content

Commit 5affa3b

Browse files
zaniebzaniebot
andauthored
Publish signed macOS and Windows release artifacts (#21447)
We added signing of artifacts in dry-run in #21525, here, we hook them up to the production publication pipeline. --------- Co-authored-by: zaniebot <[email protected]>
1 parent aa9bb65 commit 5affa3b

3 files changed

Lines changed: 76 additions & 12 deletions

File tree

‎.github/workflows/publish-mirror.yml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
plan:
1010
required: true
1111
type: string
12+
github-archives:
13+
description: "Artifact ID for the verified signed GitHub release archives"
14+
required: true
15+
type: string
1216

1317
permissions: {}
1418

@@ -27,7 +31,13 @@ jobs:
2731
- name: "Download GitHub Artifacts"
2832
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
2933
with:
30-
pattern: artifacts-*
34+
pattern: "artifacts-!(*-apple-darwin|*-pc-windows-msvc)"
35+
path: artifacts
36+
merge-multiple: true
37+
- name: "Download signed GitHub release archives"
38+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
39+
with:
40+
artifact-ids: ${{ inputs.github-archives }}
3141
path: artifacts
3242
merge-multiple: true
3343
- name: "Upload to R2"

‎.github/workflows/publish-pypi.yml‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ on:
1010
plan:
1111
required: true
1212
type: string
13+
uv-wheels:
14+
description: "Artifact ID for the verified signed uv wheels"
15+
required: true
16+
type: string
17+
uv-build-wheels:
18+
description: "Artifact ID for the verified signed uv_build wheels"
19+
required: true
20+
type: string
1321

1422
env:
1523
ACTIONS_CACHE_MODE: none
@@ -32,7 +40,13 @@ jobs:
3240
enable-cache: false
3341
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
3442
with:
35-
pattern: wheels_uv-*
43+
pattern: "wheels_uv-!(*-apple-darwin|*-pc-windows-msvc)"
44+
path: wheels_uv
45+
merge-multiple: true
46+
- name: "Download signed uv wheels"
47+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
48+
with:
49+
artifact-ids: ${{ inputs.uv-wheels }}
3650
path: wheels_uv
3751
merge-multiple: true
3852
- name: Publish to PyPI
@@ -54,7 +68,13 @@ jobs:
5468
enable-cache: false
5569
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
5670
with:
57-
pattern: wheels_uv_build-*
71+
pattern: "wheels_uv_build-!(*-apple-darwin|*-pc-windows-msvc)"
72+
path: wheels_uv_build
73+
merge-multiple: true
74+
- name: "Download signed uv_build wheels"
75+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
76+
with:
77+
artifact-ids: ${{ inputs.uv-build-wheels }}
5878
path: wheels_uv_build
5979
merge-multiple: true
6080
- name: Publish to PyPI

‎.github/workflows/release.yml‎

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
needs:
138138
- build-release-binaries
139139
- release-gate
140-
if: ${{ inputs.tag == 'dry-run' && github.repository == 'astral-sh/uv' && github.ref == 'refs/heads/main' }}
140+
if: ${{ github.repository == 'astral-sh/uv' && github.ref == 'refs/heads/main' }}
141141
uses: $/.github/workflows/sign-release-binaries.yml
142142
secrets: inherit
143143
permissions:
@@ -148,6 +148,7 @@ jobs:
148148
needs:
149149
- plan
150150
- build-release-binaries
151+
- sign-release-binaries
151152
if: ${{ needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload' || inputs.tag == 'dry-run' }}
152153
runs-on: "depot-ubuntu-latest-4"
153154
steps:
@@ -162,7 +163,14 @@ jobs:
162163
- name: Fetch local artifacts
163164
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
164165
with:
165-
pattern: artifacts-*
166+
# The macOS and Windows archives come from the signing job below.
167+
pattern: "artifacts-!(*-apple-darwin|*-pc-windows-msvc)"
168+
path: target/distrib/
169+
merge-multiple: true
170+
- name: Fetch signed GitHub release archives
171+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
172+
with:
173+
artifact-ids: ${{ needs.sign-release-binaries.outputs.github-archives }}
166174
path: target/distrib/
167175
merge-multiple: true
168176
- name: Generate local dist manifest
@@ -191,6 +199,7 @@ jobs:
191199
- build-release-binaries
192200
- build-docker
193201
- generate-checksum-manifest
202+
- sign-release-binaries
194203
runs-on: "depot-ubuntu-latest-4"
195204
env:
196205
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -207,7 +216,13 @@ jobs:
207216
- name: Fetch local artifacts
208217
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
209218
with:
210-
pattern: artifacts-*
219+
pattern: "artifacts-!(*-apple-darwin|*-pc-windows-msvc)"
220+
path: target/distrib/
221+
merge-multiple: true
222+
- name: Fetch signed GitHub release archives
223+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
224+
with:
225+
artifact-ids: ${{ needs.sign-release-binaries.outputs.github-archives }}
211226
path: target/distrib/
212227
merge-multiple: true
213228
- id: cargo-dist
@@ -238,8 +253,9 @@ jobs:
238253
- build-release-binaries
239254
- build-docker
240255
- build-global-artifacts
241-
# Only run if we're "publishing", and only if plan, local and global didn't fail (skipped is fine)
242-
if: ${{ always() && needs.plan.result == 'success' && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-release-binaries.result == 'skipped' || needs.build-release-binaries.result == 'success') && (needs.build-docker.result == 'skipped' || needs.build-docker.result == 'success') }}
256+
- sign-release-binaries
257+
# Only run if we're publishing and the required builds and signing succeeded (skipped builds are fine).
258+
if: ${{ always() && needs.plan.result == 'success' && needs.plan.outputs.publishing == 'true' && needs.sign-release-binaries.result == 'success' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-release-binaries.result == 'skipped' || needs.build-release-binaries.result == 'success') && (needs.build-docker.result == 'skipped' || needs.build-docker.result == 'success') }}
243259
env:
244260
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
245261
runs-on: "depot-ubuntu-latest-4"
@@ -257,7 +273,13 @@ jobs:
257273
- name: Fetch artifacts
258274
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
259275
with:
260-
pattern: artifacts-*
276+
pattern: "artifacts-!(*-apple-darwin|*-pc-windows-msvc)"
277+
path: target/distrib/
278+
merge-multiple: true
279+
- name: Fetch signed GitHub release archives
280+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
281+
with:
282+
artifact-ids: ${{ needs.sign-release-binaries.outputs.github-archives }}
261283
path: target/distrib/
262284
merge-multiple: true
263285
# This is a harmless no-op for GitHub Releases, hosting for that happens in "publish-github"
@@ -282,10 +304,13 @@ jobs:
282304
- plan
283305
- host
284306
- release-gate
307+
- sign-release-binaries
285308
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
286309
uses: $/.github/workflows/publish-pypi.yml
287310
with:
288311
plan: ${{ needs.plan.outputs.val }}
312+
uv-wheels: ${{ needs.sign-release-binaries.outputs.uv-wheels }}
313+
uv-build-wheels: ${{ needs.sign-release-binaries.outputs.uv-build-wheels }}
289314
secrets: inherit
290315
# publish jobs get escalated permissions
291316
permissions:
@@ -315,11 +340,12 @@ jobs:
315340
- host
316341
- release-gate
317342
- publish-pypi
343+
- sign-release-binaries
318344
# use "always() && ..." to allow publish jobs to skip themselves (for prereleases).
319345
# "host" however must run to completion, no skipping allowed!
320346
# `publish-crates` is intentionally not a dependency: it's not
321347
# critical to the release and isn't idempotent on retry.
322-
if: ${{ always() && needs.host.result == 'success' && needs.release-gate.result == 'success' && (needs.publish-pypi.result == 'skipped' || needs.publish-pypi.result == 'success') }}
348+
if: ${{ always() && needs.host.result == 'success' && needs.release-gate.result == 'success' && needs.sign-release-binaries.result == 'success' && (needs.publish-pypi.result == 'skipped' || needs.publish-pypi.result == 'success') }}
323349
runs-on: "ubuntu-latest"
324350
environment:
325351
name: release
@@ -336,7 +362,13 @@ jobs:
336362
- name: "Download GitHub Artifacts"
337363
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
338364
with:
339-
pattern: artifacts-*
365+
pattern: "artifacts-!(*-apple-darwin|*-pc-windows-msvc)"
366+
path: artifacts
367+
merge-multiple: true
368+
- name: "Download signed GitHub release archives"
369+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
370+
with:
371+
artifact-ids: ${{ needs.sign-release-binaries.outputs.github-archives }}
340372
path: artifacts
341373
merge-multiple: true
342374
- name: Cleanup
@@ -403,10 +435,12 @@ jobs:
403435
needs:
404436
- plan
405437
- publish-github
406-
if: ${{ always() && needs.publish-github.result == 'success' }}
438+
- sign-release-binaries
439+
if: ${{ always() && needs.publish-github.result == 'success' && needs.sign-release-binaries.result == 'success' }}
407440
uses: $/.github/workflows/publish-mirror.yml
408441
with:
409442
plan: ${{ needs.plan.outputs.val }}
443+
github-archives: ${{ needs.sign-release-binaries.outputs.github-archives }}
410444
secrets: inherit
411445
permissions:
412446
"contents": "read"

0 commit comments

Comments
 (0)