-
Notifications
You must be signed in to change notification settings - Fork 43
106 lines (89 loc) · 2.74 KB
/
build-wheels.yml
File metadata and controls
106 lines (89 loc) · 2.74 KB
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
name: Build wheels
on:
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels (simple matrix)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python_tag: [cp39, cp310, cp311, cp312, cp313]
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
with:
output-dir: wheelhouse
package-dir: owa-epanet
env:
CIBW_BUILD: ${{ matrix.python_tag }}-*
CIBW_SKIP: "*-manylinux_i686 *-musllinux_* *-win32"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_BEFORE_ALL_LINUX: git submodule update --init && dnf install swig -y
CIBW_BEFORE_ALL_WINDOWS: git submodule update && choco install swig
CIBW_BEFORE_ALL_MACOS: git submodule update && brew install swig ninja libomp
CIBW_BEFORE_BUILD: pip install scikit-build cmake
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_COMMAND: pytest {package}
CIBW_BEFORE_TEST: pip install scikit-build cmake
CIBW_TEST_REQUIRES: pytest
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python_tag }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Fix submodules
run: |
cd owa-epanet
git submodule update
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.12"
- name: Install dependencies
run: |
sudo apt update
sudo apt install swig -y
pip install build scikit-build cmake
- name: Build sdist
run: |
cd owa-epanet
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: owa-epanet/dist/*.tar.gz
upload_pypi:
needs: [ build_wheels, build_sdist ]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
pattern: wheels-*
merge-multiple: true
- uses: actions/download-artifact@v4
with:
path: dist
pattern: sdist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true