-
Notifications
You must be signed in to change notification settings - Fork 119
203 lines (200 loc) · 6.88 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
191
192
193
194
195
196
197
198
199
200
201
202
203
# modified from https://github.com/Qiskit/rustworkx/blob/main/.github/workflows/wheels.yml
name: Wheel Builds
# on:
# push:
# tags:
# - '*'
on:
release:
types:
- published
jobs:
# gsea-core:
# name: Publish gsea-core
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# override: true
# - name: Run cargo publish
# run: |
# cd rustworkx-core
# cargo publish
# env:
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
sdist:
name: Build sdist
runs-on: ubuntu-latest
# needs: ["build_wheels"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install deps
run: pip install -U twine setuptools-rust
- name: Build sdist
run: python setup.py sdist
- uses: actions/upload-artifact@v3
with:
path: ./dist/*
- name: Upload to PyPI
run: twine upload ./dist/*
env:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_USERNAME: __token__
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.16.5 twine wheel
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- -y"
CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"'
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.9
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64:latest
CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2014_i686:latest
CIBW_SKIP: cp36-* pp* *win32 *musl*
CIBW_BEFORE_BUILD: pip install -U setuptools-rust
# CIBW_TEST_REQUIRES: numpy scipy pandas requests
# CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
- name: Upload to PyPI
run: twine upload ./wheelhouse/*.whl
env:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_USERNAME: __token__
build_wheels_aarch64:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.16.5 twine
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- -y"
CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"'
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.9
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64:latest
CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2014_i686:latest
CIBW_SKIP: cp36-* pp* *win32 *musl*
CIBW_BEFORE_BUILD: pip install -U setuptools-rust
# CIBW_TEST_REQUIRES: numpy scipy pandas requests
# CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/
CIBW_ARCHS_LINUX: aarch64
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
- name: Upload to PyPI
run: twine upload ./wheelhouse/*.whl
env:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_USERNAME: __token__
build-mac-arm-wheels:
name: Build wheels on macos for arm and universal2
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: joerick/cibuildwheel@v2.16.5
env:
CIBW_BEFORE_ALL: rustup target add aarch64-apple-darwin
CIBW_ARCHS_MACOS: arm64 universal2
CIBW_BEFORE_BUILD: pip install -U setuptools-rust
CIBW_ENVIRONMENT: CARGO_BUILD_TARGET="aarch64-apple-darwin" PYO3_CROSS_LIB_DIR="/Library/Frameworks/Python.framework/Versions/$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')/lib/python$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')"
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
- name: Install twine
run: |
python -m pip install twine
- name: Upload to PyPI
run: twine upload ./wheelhouse/*.whl
env:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_USERNAME: __token__
build-win32-wheels:
name: Build wheels on win32
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
architecture: 'x86'
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: i686-pc-windows-msvc
default: true
- name: Force win32 rust
run: rustup default stable-i686-pc-windows-msvc
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.16.5 twine
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.9
CIBW_SKIP: cp36-* pp* *amd64 *musl*
CIBW_BEFORE_BUILD: pip install -U setuptools-rust
# CIBW_TEST_REQUIRES: numpy scipy pandas requests
# CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
- name: Upload to PyPI
run: twine upload ./wheelhouse/*.whl
env:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_USERNAME: __token__