-
Notifications
You must be signed in to change notification settings - Fork 42
190 lines (184 loc) · 6.41 KB
/
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
183
184
185
186
187
188
189
190
name: Build and test wheels
on:
workflow_dispatch:
push:
tags:
- v*
jobs:
wheels:
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
arch: ["x86_64", "arm64"]
include:
- os: windows-2019
arch: win_amd64
- os: windows-2019
arch: win32
- os: ubuntu-20.04
arch: i686
- os: ubuntu-20.04
arch: aarch64
- os: ubuntu-20.04
arch: ppc64le
- os: ubuntu-20.04
arch: s390x
exclude:
- os: windows-2019
arch: "x86_64"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Build and test wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "*${{ matrix.arch }}"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-${{ matrix.arch }}
path: wheelhouse/*.whl
if-no-files-found: error
wheels-old:
name: Build old wheels on ${{ matrix.os }} for ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
arch: ["x86_64"]
include:
- os: windows-2019
arch: win_amd64
- os: windows-2019
arch: win32
- os: ubuntu-20.04
arch: i686
- os: ubuntu-20.04
arch: aarch64
- os: ubuntu-20.04
arch: ppc64le
- os: ubuntu-20.04
arch: s390x
exclude:
- os: windows-2019
arch: "x86_64"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Build and test wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: all
CIBW_BUILD_VERBOSITY: 3
CIBW_BUILD: "*${{ matrix.arch }}"
CIBW_SKIP: cp36-* cp37-* cp38-* cp39-* pp37-* pp*-macosx* cp35-macosx_x86_64
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/tests
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-${{ matrix.arch }}
path: wheelhouse/*.whl
if-no-files-found: error
wheels-win27:
name: Build Python 2.7 wheels on Windows ${{ matrix.arch }}
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
arch: ["amd64", "win32"]
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Prepare compiler environment for Windows
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Set Windows environment variables
if: runner.os == 'Windows'
shell: bash
run: |
echo "DISTUTILS_USE_SDK=1" >> $GITHUB_ENV
echo "MSSdk=1" >> $GITHUB_ENV
- name: Build and test wheels
uses: pypa/[email protected]
env:
CIBW_BUILD_VERBOSITY: 3
CIBW_BUILD: "*27*${{ matrix.arch }}"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/tests
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-${{ matrix.arch }}
path: wheelhouse/*.whl
if-no-files-found: error
sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
# Build sdist on lowest supported Python.
# 3.8 is used because 3.6 has issues with pyproject.toml
# and 3.7 has bpo-41316.
python-version: '3.8'
- name: Build sdist
run: |
python -m pip install -U pip
python -m pip install -U build
python -m build -s
- name: Test sdist
run : python -m pip install dist/*.gz
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: sdist
path: dist/*
if-no-files-found: error
publish:
name: Publish builds on PyPI
runs-on: ubuntu-latest
needs: [sdist, wheels, wheels-old, wheels-win27]
if: ${{ always() && (needs.sdist.result == 'success' || needs.wheels.result == 'success' || needs.wheels-old.result == 'success' || needs.wheels-win27.result == 'success') }}
environment:
name: release
url: https://test.pypi.org/p/python-lzo
permissions:
id-token: write
steps:
- name: Download builds
uses: actions/[email protected]
with:
path: dist
- name: Organise
working-directory: dist
run: |
mv **/*.whl .
mv **/*.gz .
find . -type d -delete
- name: Display structure of downloaded files
run: ls -R
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
print-hash: true
repository-url: https://test.pypi.org/legacy/