forked from datastax/python-driver
-
Notifications
You must be signed in to change notification settings - Fork 43
173 lines (139 loc) · 4.91 KB
/
build-push.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
name: Build and upload to PyPi
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels ${{ matrix.os }} (${{ matrix.platform }})
if: "(!contains(github.event.pull_request.labels.*.name, 'disable-test-build')) || github.event_name == 'push' && endsWith(github.event.ref, 'scylla')"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
platform: x86_64
- os: ubuntu-20.04
platform: PyPy
- os: windows-latest
platform: win64
- os: windows-latest
platform: PyPy
- os: macos-latest
platform: all
- os: macos-13
platform: all
- os: macos-latest
platform: PyPy
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.13'
- name: Enable pip installing globally
if: runner.os == 'MacOs' || runner.os == 'Windows'
run: |
echo "PIP_BREAK_SYSTEM_PACKAGES=1" >> $GITHUB_ENV
- name: Install cibuildwheel
run: |
python3 -m pip install cibuildwheel==2.22.0
- name: Install OpenSSL for Windows
if: runner.os == 'Windows'
run: |
choco install openssl --version=3.3.2 -f -y
- name: Install Conan
if: runner.os == 'Windows'
uses: turtlebrowser/get-conan@main
- name: configure libev for Windows
if: runner.os == 'Windows'
run: |
conan profile detect
conan install conanfile.py
- name: Install OpenSSL for MacOS
if: runner.os == 'MacOs'
run: |
brew install libev
- name: Overwrite for Linux PyPy
if: runner.os == 'Linux' && matrix.platform == 'PyPy'
run: |
echo "CIBW_BUILD=pp*" >> $GITHUB_ENV
- name: Overwrite for Windows PyPY
if: runner.os == 'Windows' && matrix.platform == 'PyPy'
run: |
echo "CIBW_BUILD=pp*" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Overwrite for MacOs PyPy
if: runner.os == 'MacOs' && matrix.platform == 'PyPy'
run: |
echo "CIBW_BUILD=pp*" >> $GITHUB_ENV
- name: Build wheels
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.platform }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
if: "(!contains(github.event.pull_request.labels.*.name, 'disable-test-build'))|| github.event_name == 'push' && endsWith(github.event.ref, 'scylla')"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
- name: Build sdist
run: |
pip install build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: source-dist
path: dist/*.tar.gz
build_wheels_extra_arch:
if: "(!contains(github.event.pull_request.labels.*.name, 'disable-test-build'))|| github.event_name == 'push' && endsWith(github.event.ref, 'scylla')"
# The host should always be linux
runs-on: ubuntu-20.04
name: Build extra arch ${{ matrix.archs }} wheels
strategy:
fail-fast: false
matrix:
archs: [ aarch64,] # ppc64le ]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
platforms: all
if: runner.os == 'Linux'
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.13'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.22.0
- name: Build wheels
env:
CIBW_BUILD: "cp39* cp310* cp311* cp312*" # limit to specific version since it take much more time than jobs limit
run: |
python -m cibuildwheel --archs ${{ matrix.archs }} --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.archs }}
path: ./wheelhouse/*.whl
upload_pypi:
needs: [build_wheels, build_wheels_extra_arch, build_sdist]
runs-on: ubuntu-20.04
permissions:
id-token: write
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && endsWith(github.event.ref, 'scylla')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true