-
Notifications
You must be signed in to change notification settings - Fork 257
88 lines (72 loc) · 2.55 KB
/
main.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
name: CI
on:
push:
branches: [ main ]
tags: [ "*" ]
pull_request:
branches: [ main ]
jobs:
build_wheels:
runs-on: ${{ matrix.target[0] }}
strategy:
fail-fast: false
matrix:
target: # [ os, cibuildwheel-platform ]
- [ macos-latest, macosx_x86_64 ]
- [ macos-latest, macosx_arm64 ]
- [ ubuntu-latest, manylinux_aarch64 ]
- [ ubuntu-latest, manylinux_x86_64 ]
- [ windows-latest, win_amd64 ]
python-version: [ "cp38-", "cp39-", "cp310-", "cp311-" ]
steps:
- uses: actions/checkout@v3
- name: Build CMake targets
run: |
mkdir cmake-build-release
cd cmake-build-release
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install twine
- if: matrix.target[0] == 'ubuntu-latest'
name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Build wheel
uses: pypa/[email protected]
env:
CIBW_ARCHS: all
CIBW_BUILD: ${{ matrix.python-version }}${{ matrix.target[1] }}
CIBW_BEFORE_BUILD: pip install numpy
CIBW_BEFORE_TEST: pip install numpy matplotlib
CIBW_TEST_COMMAND: cd {project}/Python && python advanced_example.py dont_show && python simple_example.py dont_show
CIBW_TEST_COMMAND_WINDOWS: cd /D {project}/Python && python advanced_example.py dont_show && python simple_example.py dont_show
- if: startsWith(github.ref, 'refs/tags/v')
name: Upload wheel
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TOKEN }}
run: python -m twine upload --verbose --repository pypi wheelhouse/* --skip-existing
build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9" # build sdist on lowest supported Python
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install numpy
python -m pip install twine
- name: Build sdist
run: python setup.py sdist
- if: startsWith(github.ref, 'refs/tags/v')
name: Upload sdist
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TOKEN }}
run: python -m twine upload --verbose --repository pypi dist/*