Repository navigation
226 lines (213 loc) · 8.2 KB
/
Copy pathpython_release.yml
File metadata and controls
226 lines (213 loc) · 8.2 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
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: Release to PyPI and documentation
on:
push:
tags: ["python-v*"]
defaults:
run:
working-directory: ./python
jobs:
validate-release-tag:
name: Validate git tag
runs-on: ubuntu-slim
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: compare git tag with cargo metadata
run: |
PUSHED_TAG=${GITHUB_REF##*/}
CURR_VER=$( grep version Cargo.toml | head -n 1 | awk '{print $3}' | tr -d '"' )
if [[ "${PUSHED_TAG}" != "python-v${CURR_VER}" ]]; then
echo "Cargo metadata has version set to ${CURR_VER}, but got pushed tag ${PUSHED_TAG}."
exit 1
fi
release-pypi-mac:
needs: validate-release-tag
name: PyPI release on Mac
strategy:
fail-fast: false
matrix:
target: [x86_64-apple-darwin, aarch64-apple-darwin]
runs-on: macos-14
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Publish to pypi (without sdist)
# <https://github.com/PyO3/maturin-action/releases/tag/v1.50.1>
uses: messense/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
target: ${{ matrix.target }}
command: publish
args: --skip-existing --no-sdist -m python/Cargo.toml --profile python-release
release-pypi-windows:
needs: validate-release-tag
name: PyPI release on Windows (${{ matrix.architecture }})
strategy:
fail-fast: false
matrix:
include:
- runner: windows-latest
architecture: x64
target: x86_64-pc-windows-msvc
profile: python-release
- runner: windows-11-arm
architecture: arm64
target: aarch64-pc-windows-msvc
profile: python-release-arm
runs-on: ${{ matrix.runner }}
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
# <https://github.com/actions/setup-python/releases/tag/v6.2.0>
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: '3.11'
architecture: ${{ matrix.architecture }}
- name: Configure ARM64 native compiler
if: matrix.architecture == 'arm64'
shell: pwsh
run: |
$llvm = "$env:ProgramFiles\LLVM\bin"
if (!(Test-Path "$llvm\clang.exe") -or !(Test-Path "$llvm\clang-cl.exe")) {
throw "LLVM clang and clang-cl are required for Windows ARM64"
}
$llvm >> $env:GITHUB_PATH
"CC_aarch64_pc_windows_msvc=clang-cl" >> $env:GITHUB_ENV
"CXX_aarch64_pc_windows_msvc=clang-cl" >> $env:GITHUB_ENV
- name: Publish to pypi (without sdist)
# <https://github.com/PyO3/maturin-action/releases/tag/v1.50.1>
uses: messense/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
target: ${{ matrix.target }}
rust-toolchain: stable
command: publish
args: --skip-existing --no-sdist -m python/Cargo.toml --interpreter python --profile ${{ matrix.profile }}
release-pypi-sdist:
needs: validate-release-tag
name: PyPI source distribution (sdist)
runs-on: ubuntu-24.04
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
# This is the sole sdist publisher. All wheel jobs use --no-sdist.
# See: https://github.com/delta-io/delta-rs/issues/4645
- name: Build sdist
# <https://github.com/PyO3/maturin-action/releases/tag/v1.50.1>
uses: messense/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
with:
command: sdist
args: -m python/Cargo.toml
- name: Upload sdist to PyPI
# <https://github.com/PyO3/maturin-action/releases/tag/v1.50.1>
uses: messense/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
command: upload
args: --skip-existing target/wheels/*.tar.gz
release-pypi-manylinux-x86-64:
needs: validate-release-tag
name: PyPI release on Linux (x86_64-manylinux-2_17)
runs-on: ubuntu-24.04
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Publish manylinux to pypi x86_64 (without sdist)
# <https://github.com/PyO3/maturin-action/releases/tag/v1.50.1>
uses: messense/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
target: x86_64-unknown-linux-gnu
command: publish
container: off
args: --skip-existing --no-sdist -m python/Cargo.toml --zig --profile python-release
manylinux: "2_17"
release-pypi-manylinux-228-aarch64:
needs: validate-release-tag
name: PyPI release on Linux (aarch64-manylinux-2_28)
runs-on: ubuntu-24.04-arm
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Publish manylinux to pypi aarch64 (without sdist)
# <https://github.com/PyO3/maturin-action/releases/tag/v1.50.1>
uses: messense/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
# Build with support for 64K pages on arm instances which is a thing
# it turns out
#
# <https://github.com/delta-io/delta-rs/issues/4413>
JEMALLOC_SYS_WITH_LG_PAGE: 16
with:
target: aarch64-unknown-linux-gnu
command: publish
container: off
args: --skip-existing --no-sdist -m python/Cargo.toml --zig --profile python-release-arm
manylinux: "2_28"
release-pypi-musl-x86-64:
needs: validate-release-tag
name: PyPI release on Linux (x86_64-musl)
runs-on: ubuntu-24.04
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Publish musl to pypi x86_64 (without sdist)
# <https://github.com/PyO3/maturin-action/releases/tag/v1.50.1>
uses: messense/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
target: x86_64-unknown-linux-musl
command: publish
args: --skip-existing --no-sdist -m python/Cargo.toml --zig --profile python-release
release-pypi-musl-aarch64:
needs: validate-release-tag
name: PyPI release on Linux (aarch64-musl)
runs-on: ubuntu-24.04-arm
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Publish musl to pypi aarch64 (without sdist)
# <https://github.com/PyO3/maturin-action/releases/tag/v1.50.1>
uses: messense/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
# Build with support for 64K pages on arm instances which is a thing
# it turns out
#
# <https://github.com/delta-io/delta-rs/issues/4413>
JEMALLOC_SYS_WITH_LG_PAGE: 16
with:
target: aarch64-unknown-linux-musl
command: publish
args: --skip-existing --no-sdist -m python/Cargo.toml --zig --profile python-release-arm
release-docs:
needs:
[
validate-release-tag,
release-pypi-sdist,
release-pypi-manylinux-x86-64,
release-pypi-manylinux-228-aarch64,
release-pypi-musl-x86-64,
release-pypi-musl-aarch64,
release-pypi-mac,
release-pypi-windows,
]
permissions:
contents: write
runs-on: ubuntu-slim
steps:
- name: Trigger the docs release event
# <https://github.com/peter-evans/repository-dispatch/releases/tag/v4.0.1>
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697
with:
event-type: release-docs
client-payload: >
{
"tag": "${{ github.ref_name }}"
}