forked from delta-io/delta-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (154 loc) · 4.91 KB
/
python_release.yml
File metadata and controls
176 lines (154 loc) · 4.91 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
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-latest
steps:
- uses: actions/checkout@v5
- 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:
- uses: actions/checkout@v5
- uses: Swatinem/rust-cache@v2
with:
cache-targets: false
- name: Publish to pypi (without sdist)
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
target: ${{ matrix.target }}
command: publish
args: --skip-existing -m python/Cargo.toml --no-sdist
release-pypi-windows:
needs: validate-release-tag
name: PyPI release on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- uses: Swatinem/rust-cache@v2
with:
cache-targets: false
- name: Publish to pypi (without sdist)
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
target: x86_64-pc-windows-msvc
command: publish
args: --skip-existing -m python/Cargo.toml --no-sdist
release-pypi-manylinux-x86-64:
needs: validate-release-tag
name: PyPI release manylinux-2_17 x86_64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: Swatinem/rust-cache@v2
with:
cache-targets: false
- name: Publish manylinux to pypi x86_64 (with sdist)
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
target: x86_64-unknown-linux-gnu
command: publish
args: --skip-existing -m python/Cargo.toml
release-pypi-manylinux-217-aarch64:
needs: validate-release-tag
name: PyPI release manylinux-2_17 aarch64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: Swatinem/rust-cache@v2
with:
cache-targets: false
- name: Publish manylinux to pypi aarch64 (without sdist)
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
target: aarch64-unknown-linux-gnu
command: publish
args: --skip-existing -m python/Cargo.toml --no-sdist
before-script-linux: |
# We can remove this once we upgrade to 2_28.
# https://github.com/briansmith/ring/issues/1728
export CFLAGS_aarch64_unknown_linux_gnu="-D__ARM_ARCH=8"
release-pypi-manylinux-228-aarch64:
needs: validate-release-tag
name: PyPI release manylinux-2_28 aarch64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: Swatinem/rust-cache@v2
with:
cache-targets: false
- name: Publish manylinux to pypi aarch64 manylinux-2_28 (without sdist)
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
target: aarch64-unknown-linux-gnu
command: publish
args: --skip-existing -m python/Cargo.toml --no-sdist
manylinux: "2_28"
release-pypi-musl-x86-64:
needs: validate-release-tag
name: PyPI release musl-2_17 x86_64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: Swatinem/rust-cache@v2
with:
cache-targets: false
- name: Publish manylinux to pypi x86_64 (with sdist)
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
target: x86_64-unknown-linux-musl
command: publish
args: --skip-existing -m python/Cargo.toml --zig
release-docs:
needs:
[
validate-release-tag,
release-pypi-manylinux-x86-64,
release-pypi-manylinux-217-aarch64,
release-pypi-manylinux-228-aarch64,
release-pypi-mac,
release-pypi-windows,
]
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Trigger the docs release event
uses: peter-evans/repository-dispatch@v2
with:
event-type: release-docs
client-payload: >
{
"tag": "${{ github.ref_name }}"
}