-
Notifications
You must be signed in to change notification settings - Fork 241
146 lines (135 loc) · 4.78 KB
/
copy_prebuilt_artifacts.yml
File metadata and controls
146 lines (135 loc) · 4.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Copyright Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
# Reusable workflow that materializes a release run's artifact prefix from a
# fixed "prebuilt" prefix in the active artifact namespace.
#
# Behavior:
# - If `prebuilt_prefix` is empty, the job runs but is a successful no-op.
# Downstream jobs can keep `needs:` on this workflow without conditional
# plumbing for normal source-build runs.
# - If `prebuilt_prefix` is non-empty, the job copies all stage artifacts
# from that prefix into the active run's prefix using
# `artifact_manager.py copy --source-prefix-only --stage=all
# --require-matches`.
#
# This workflow is also exposed as `workflow_dispatch` for manual reruns,
# e.g. when re-staging a patched prebuilt prefix.
name: Copy Prebuilt Artifacts
on:
workflow_call:
inputs:
prebuilt_prefix:
description: >-
Source prefix component (the part before "-linux"/"-windows") to
copy artifacts from. Empty means no-op (source-build mode).
type: string
default: ""
platform:
description: 'Platform: "linux" or "windows".'
type: string
required: true
amdgpu_families:
description: "Semicolon-separated GPU families to copy."
type: string
required: true
expand_family_to_targets:
description: >-
Pass --expand-family-to-targets to artifact_manager copy. Required
for kpack-split (multi-arch) prefixes; should be false for
single-family release builds.
type: boolean
default: false
release_type:
description: 'Release type: "dev", "nightly", or "prerelease".'
type: string
required: true
repository:
description: "Repository to checkout. Defaults to github.repository."
type: string
default: ""
ref:
description: "Branch, tag, or SHA to checkout. Defaults to the triggering ref."
type: string
default: ""
workflow_dispatch:
inputs:
prebuilt_prefix:
description: 'Source prefix (e.g. "rerun-2026-04-30").'
type: string
required: true
platform:
description: 'Platform: "linux" or "windows".'
type: choice
options:
- linux
- windows
default: linux
amdgpu_families:
description: "Semicolon-separated GPU families to copy."
type: string
required: true
expand_family_to_targets:
description: "Pass --expand-family-to-targets to artifact_manager copy."
type: boolean
default: false
release_type:
description: 'Release type: "dev", "nightly", or "prerelease".'
type: choice
options:
- dev
- nightly
- prerelease
default: dev
ref:
description: "Branch, tag, or SHA to checkout."
type: string
default: ""
permissions:
contents: read
run-name: >-
Copy Prebuilt Artifacts
(${{ inputs.platform }}, ${{ inputs.release_type }}) | prebuilt: ${{ inputs.prebuilt_prefix }}
jobs:
copy:
name: Copy Prebuilt Artifacts
runs-on: ubuntu-24.04
permissions:
contents: read
id-token: write
steps:
- name: No-op when prebuilt_prefix is empty
if: ${{ inputs.prebuilt_prefix == '' }}
run: echo "prebuilt_prefix is empty; skipping copy (source-build mode)."
- name: Checkout
if: ${{ inputs.prebuilt_prefix != '' }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref }}
- name: Setup Python
if: ${{ inputs.prebuilt_prefix != '' }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: Install artifact manager dependencies
if: ${{ inputs.prebuilt_prefix != '' }}
run: pip install boto3
- name: Configure AWS credentials
if: ${{ inputs.prebuilt_prefix != '' }}
uses: ./.github/actions/configure_aws_artifacts_credentials
with:
release_type: ${{ inputs.release_type }}
- name: Copy prebuilt artifacts
if: ${{ inputs.prebuilt_prefix != '' }}
env:
GITHUB_TOKEN: ${{ github.token }}
RELEASE_TYPE: ${{ inputs.release_type }}
run: |
python build_tools/artifact_manager.py copy \
--source-run-id="${{ inputs.prebuilt_prefix }}" \
--source-prefix-only \
--stage=all \
--platform="${{ inputs.platform }}" \
--amdgpu-families="${{ inputs.amdgpu_families }}" \
${{ inputs.expand_family_to_targets && '--expand-family-to-targets' || '' }} \
--require-matches