forked from PlusToolkit/ndicapi
-
Notifications
You must be signed in to change notification settings - Fork 3
89 lines (77 loc) · 2.98 KB
/
ci.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
on: push
jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
python-ver: [3.7, 3.8, 3.9, '3.10', '3.11']
os: [ubuntu-latest, windows-latest, macos-latest]
experimental: [false]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-ver }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel twine auditwheel
- name: Add msbuild to PATH
if: matrix.os == 'windows-latest'
uses: microsoft/[email protected]
- name: build Windows
if: matrix.os == 'windows-latest'
run: |
mkdir build
mkdir install
cd build
cmake -G "Visual Studio 17 2022" -A x64 -DBUILD_PYTHON:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -Dndicapi_BUILD_APPLICATIONS:BOOL=OFF -DCMAKE_INSTALL_PREFIX=../install ..
cmake --build .
cd ../
python.exe setup.py sdist bdist_wheel --plat-name win_amd64
python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/* --skip-existing
rm -r build
rm -r install
- name: build Windows-32bit
if: matrix.os == 'windows-latest'
run: |
mkdir build
mkdir install
cd build
cmake -G "Visual Studio 17" -A Win32 -DBUILD_PYTHON:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -Dndicapi_BUILD_APPLICATIONS:BOOL=OFF -DCMAKE_INSTALL_PREFIX=../install ..
cmake --build .
cd ../
python.exe setup.py sdist bdist_wheel --plat-name win32
python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/* --skip-existing
rm -r build
rm -r install
- name: build ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
mkdir build
cd build
cmake -DBUILD_PYTHON:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -Dndicapi_BUILD_APPLICATIONS:BOOL=OFF ..
make
cd ..
- name: build ubuntu manylinux
if: matrix.os == 'ubuntu-latest'
uses: RalfG/[email protected]_x86_64
with:
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
- name: upload manylinux
if: matrix.os == 'ubuntu-latest'
run: |
python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/*-manylinux*.whl --skip-existing
- name: build macos
if: matrix.os == 'macos-latest'
run: |
mkdir build
cd build
cmake -DBUILD_PYTHON:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -Dndicapi_BUILD_APPLICATIONS:BOOL=OFF ..
make
cd ..
python setup.py sdist bdist_wheel
python -m twine upload -u __token__ -p ${{secrets.PYPI_API_TOKEN}} dist/* --skip-existing