-
Notifications
You must be signed in to change notification settings - Fork 64
172 lines (163 loc) · 4.61 KB
/
publish.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
name: 'Build and Publish Release'
on:
workflow_dispatch:
inputs:
publish_type:
description: Publish Type
type: choice
default: test
options:
- test
- release
- build
env:
CIBW_SKIP: 'cp36-* cp37-* pp37-*'
jobs:
build_x86_manylinux_wheels:
name: Build x86 manylinux wheels on Linux
runs-on: ubuntu-latest
env:
CIBW_SKIP: 'cp36-* cp37-* pp37-* *-musllinux*'
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
- uses: actions/upload-artifact@v4
with:
name: build-x86-manylinux
path: ./wheelhouse/*.whl
build_x86_musllinux_wheels:
name: Build x86 musllinux wheels on Linux
runs-on: ubuntu-latest
env:
CIBW_SKIP: 'cp36-* cp37-* pp37-* *-manylinux*'
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
- uses: actions/upload-artifact@v4
with:
name: build-x86-musllinux
path: ./wheelhouse/*.whl
build_aarch64_manylinux_wheels:
name: Build aarch64 manylinux wheels
runs-on: ubuntu-latest
env:
CIBW_ARCHS_LINUX: aarch64
CIBW_SKIP: 'cp36-* cp37-* pp* *-musllinux*'
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
- uses: actions/upload-artifact@v4
with:
name: build-aarch64-manylinux
path: ./wheelhouse/*.whl
build_aarch64_musllinux_wheels:
name: Build aarch64 musllinux wheels
runs-on: ubuntu-latest
env:
CIBW_ARCHS_LINUX: aarch64
CIBW_SKIP: 'cp36-* cp37-* pp* *-manylinux*'
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
- uses: actions/upload-artifact@v4
with:
name: build-aarch64-musllinux
path: ./wheelhouse/*.whl
build_aarch64_pypy_wheels:
name: Build aarch64 PyPy wheels
runs-on: ubuntu-latest
env:
CIBW_ARCHS_LINUX: aarch64
CIBW_BUILD: 'pp*'
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
- uses: actions/upload-artifact@v4
with:
name: build-aarch64-pypy
path: ./wheelhouse/*.whl
build_macos_wheels:
name: Build wheels on macos
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_ARCHS_MACOS: x86_64 arm64
- uses: actions/upload-artifact@v4
with:
name: build-macos
path: ./wheelhouse/*.whl
build_windows_wheels:
name: Build wheels on Windows
runs-on: windows-latest
env:
CIBW_BUILD_VERBOSITY: 2
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
- uses: actions/upload-artifact@v4
with:
name: build-windows
path: ./wheelhouse/*.whl
publish:
needs:
- build_macos_wheels
- build_windows_wheels
- build_x86_musllinux_wheels
- build_x86_manylinux_wheels
- build_aarch64_musllinux_wheels
- build_aarch64_manylinux_wheels
- build_aarch64_pypy_wheels
name: Publish to PyPI
runs-on: ubuntu-latest
if: ${{ inputs.publish_type != 'build' }}
steps:
- uses: actions/checkout@v4
- name: Build source distribution
run: |
rm -rf dist
python setup.py sdist
- name: Retrieve wheels
uses: actions/download-artifact@v4
with:
pattern: build-*
merge-multiple: true
path: wheelhouse
- name: move and list artifacts
run: |
cp -R wheelhouse/*.whl dist
ls -R dist
- name: Install Twine
run: pip install twine
- name: Publish (Release)
if: ${{ inputs.publish_type == 'release' }}
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*
- name: Publish (Test)
if: ${{ inputs.publish_type == 'test' }}
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }}
run: twine upload --repository testpypi dist/*