Skip to content

Switched to cibuildwheel to get the wheel name correct on macos, fixe… #97

Switched to cibuildwheel to get the wheel name correct on macos, fixe…

Switched to cibuildwheel to get the wheel name correct on macos, fixe… #97

Workflow file for this run

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-2019
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 16 2019" -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
- 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 }}