-
-
Notifications
You must be signed in to change notification settings - Fork 8
124 lines (118 loc) · 3.7 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
name: Build and publish wheels on PyPI
on:
release:
types: [created]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
linux-x86-wheels:
runs-on: ubuntu-latest
strategy:
matrix:
container:
- "quay.io/pypa/musllinux_1_2_x86_64"
- "quay.io/pypa/manylinux_2_28_x86_64"
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- name: Build wheels
run: |
bash .github/workflows/build-wheels.sh
- uses: actions/upload-artifact@v3
with:
name: wheels
path: wheelhouse
if-no-files-found: error
linux-aarch-wheels:
runs-on: ubuntu-latest
strategy:
matrix:
container:
- "quay.io/pypa/musllinux_1_2_aarch64"
- "quay.io/pypa/manylinux_2_28_aarch64"
steps:
- uses: actions/checkout@v4
- name: Install QEMU
run: |
docker run --privileged --rm tonistiigi/binfmt --install arm64
- name: Build wheels
run: |
docker run --platform linux/arm64 --workdir /src -v ${PWD}:/src ${{ matrix.container }} /bin/bash .github/workflows/build-wheels.sh
- uses: actions/upload-artifact@v3
with:
name: wheels
path: wheelhouse
if-no-files-found: error
osx-wheels:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build wheels
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
python3 -m pip install -r requirements.txt -r requirements-dev.txt
maturin build --release --strip --target universal2-apple-darwin
python3 -m pip install kmedoids --no-index --find-links target/wheels
cd tests && python3 -m unittest discover && cd ..
- uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels
if-no-files-found: error
windows-wheels:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build wheels
run: |
python -m pip install -r requirements.txt -r requirements-dev.txt
maturin build --release --strip
python -m pip install kmedoids --no-index --find-links target/wheels
cd tests && python -m unittest discover && cd ..
- uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels
if-no-files-found: error
upload-wheels:
name: Upload wheels to PyPI
needs: [linux-x86-wheels, linux-aarch-wheels, osx-wheels, windows-wheels]
runs-on: ubuntu-latest
steps:
- name: Collect artifacts
uses: actions/download-artifact@v3
with:
name: wheels
path: wheels/
- name: List contents
run: ls -R
working-directory: wheels/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: wheels/
skip_existing: true
verbose: true