-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (71 loc) · 2.29 KB
/
windows.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
name: Windows Build
on:
push:
branches: [ dev, itk_update ]
tags:
- v*
pull_request:
branches: [ dev ]
workflow_dispatch:
jobs:
example_matrix:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: windows-2022
if: ${{ startsWith(github.ref, 'refs/tags') || !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- uses: actions/checkout@v4
- name: Checkout submodules
run: |
git submodule init
git submodule update
- name: Build zlib
run: |
git clone https://github.com/madler/zlib.git
md zlib-build
cd zlib-build
cmake ..\zlib -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="..\zlib-install"
cmake --build . --config Release --target install
cd ..
dir
- name: Build ITK
run: |
md ITK-build
cd ITK-build
cmake.exe -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release ..\ITK
cmake --build . --config Release --target Install
cd ..
shell: cmd
- name: Build and test samseg python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- run: |
python -m pip wheel . -w .\dist --no-deps
python -m pip install . -f .\dist\
#python -m pip install -r requirements.txt
#python -m pip install pytest
#python -m pip install tensorflow
cd ..
python -c 'import samseg'
# python -m pytest samseg\samseg\tests
rm samseg\gems\*.pyd
rm samseg\gems\Release\*.pyd
env:
ZLIB_INCLUDE_DIR: .\zlib-install\include
ZLIB_LIBRARY: .\zlib-install\lib\zlibstatic.lib
ITK_DIR: ITK-build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows-wheels
path: .\dist\*.whl
- name: Upload to PyPI
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
run: |
python -m pip install twine
python -m twine upload .\dist\*.whl -u __token__ -p "$env:PASSWORD"
env:
PASSWORD: ${{ secrets.PYPI_TOKEN }}