-
Notifications
You must be signed in to change notification settings - Fork 385
182 lines (161 loc) · 5.43 KB
/
reusable_publish_wheels.yml
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Build and publish wheels
# To run this manually:
# 1. Build each platform using `scripts/ci/build_and_upload_wheels.py`
# 2. (optional) Generate index using `scripts/ci/generate_prerelease_pip_index.py`
# 3. Publish to PyPI using `scripts/ci/publish_wheels.py`
on:
workflow_call:
inputs:
concurrency:
type: string
required: true
release-version:
description: "Release Version Number (Must match Cargo.toml)"
type: string
required: true
release-commit:
description: "Which commit to build+publish"
type: string
required: true
defaults:
run:
shell: bash
permissions:
contents: "read"
id-token: "write"
jobs:
get-commit-sha:
name: Get Commit Sha
runs-on: ubuntu-latest
outputs:
short-sha: ${{ steps.get-short-sha.outputs.short-sha }}
full-sha: ${{ steps.get-full-sha.outputs.full-sha }}
steps:
- name: "Set short-sha"
id: get-short-sha
run: echo "short-sha=$(echo ${{ inputs.release-commit }} | cut -c1-7)" >> $GITHUB_OUTPUT
- name: "Set full-sha"
id: get-full-sha
run: echo "full-sha=${{ inputs.release-commit }}" >> $GITHUB_OUTPUT
## Build
# Note: this also builds `rerun_notebook`
build-linux-x64:
name: "Linux-x64: Build Wheels"
needs: [get-commit-sha]
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: wheels-build-linux-x64-${{ inputs.concurrency }}
PLATFORM: linux-x64
WHEEL_ARTIFACT_NAME: linux-x64-wheel
RELEASE_COMMIT: ${{ inputs.release-commit }}
MODE: "pypi"
secrets: inherit
build-linux-arm64:
name: "Linux-arm64: Build Wheels"
needs: [get-commit-sha]
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: wheels-build-linux-arm64-${{ inputs.concurrency }}
PLATFORM: linux-arm64
WHEEL_ARTIFACT_NAME: linux-arm64-wheel
RELEASE_COMMIT: ${{ inputs.release-commit }}
MODE: "pypi"
secrets: inherit
build-windows-x64:
name: "Windows-x64: Build Wheels"
needs: [get-commit-sha]
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: wheels-build-windows-x64-${{ inputs.concurrency }}
PLATFORM: windows-x64
WHEEL_ARTIFACT_NAME: windows-x64-wheel
RELEASE_COMMIT: ${{ inputs.release-commit }}
MODE: "pypi"
secrets: inherit
build-macos-arm64:
name: "Macos-arm64: Build Wheels"
needs: [get-commit-sha]
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: wheels-build-macos-arm64-${{ inputs.concurrency }}
PLATFORM: macos-arm64
WHEEL_ARTIFACT_NAME: macos-arm64-wheel
RELEASE_COMMIT: ${{ inputs.release-commit }}
MODE: "pypi"
secrets: inherit
build-macos-x64:
name: "Macos-x64: Build Wheels"
needs: [get-commit-sha]
uses: ./.github/workflows/reusable_build_and_upload_wheels.yml
with:
CONCURRENCY: wheels-build-macos-x64-${{ inputs.concurrency }}
PLATFORM: macos-x64
WHEEL_ARTIFACT_NAME: "macos-x64-wheel"
RELEASE_COMMIT: ${{ inputs.release-commit }}
MODE: "pypi"
secrets: inherit
## Test
test-windows-x64:
name: "Windows-x64: Test Wheels"
needs: [build-windows-x64]
uses: ./.github/workflows/reusable_test_wheels.yml
with:
CONCURRENCY: wheels-test-windows-x64-${{ inputs.concurrency }}
PLATFORM: windows-x64
WHEEL_ARTIFACT_NAME: windows-x64-wheel
RELEASE_COMMIT: ${{ inputs.release-commit }}
secrets: inherit
test-linux:
name: "Linux-x64: Test Wheels"
needs: [build-linux-x64]
uses: ./.github/workflows/reusable_test_wheels.yml
with:
CONCURRENCY: wheels-test-linux-x64-${{ inputs.concurrency }}
PLATFORM: linux-x64
WHEEL_ARTIFACT_NAME: linux-x64-wheel
RELEASE_COMMIT: ${{ inputs.release-commit }}
secrets: inherit
generate-wheel-index:
name: "Generate Pip Index"
needs:
[
build-linux-x64,
build-linux-arm64,
build-windows-x64,
build-macos-arm64,
build-macos-x64,
]
uses: ./.github/workflows/reusable_pip_index.yml
with:
CONCURRENCY: generate-wheel-index-${{ inputs.concurrency }}
COMMIT: ${{ inputs.release-commit }}
secrets: inherit
publish-wheels:
name: "Publish Wheels"
needs: [get-commit-sha, generate-wheel-index]
runs-on: ubuntu-latest-16-cores
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Don't do a shallow clone since we need it for finding the full commit hash
ref: ${{ inputs.release-commit }}
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.39.0
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 363.0.0"
- name: Publish to PyPI
run: |
pixi run python scripts/ci/publish_wheels.py \
--version ${{ inputs.release-version }} \
--dir "commit/${{ needs.get-commit-sha.outputs.short-sha }}/wheels" \
--repository "${{ vars.PYPI_REPOSITORY }}" \
--token "${{ secrets.MATURIN_PYPI_TOKEN }}" \