Merge pull request #16 from jnolan14/dev #90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux Build | |
on: | |
push: | |
branches: [ dev ] | |
tags: | |
- v* | |
pull_request: | |
branches: [ dev ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: quay.io/pypa/manylinux2014_x86_64 | |
if: ${{ startsWith(github.ref, 'refs/tags') || !contains(github.event.head_commit.message, '[skip ci]') }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Checkout submodules | |
run: | | |
git config --global --add safe.directory /__w/samseg/samseg | |
git submodule init | |
git submodule update | |
- name: Download gcc 8 compilers | |
run: | | |
yum install -y centos-release-scl && \ | |
yum-config-manager --enable rhel-server-rhscl-7-rpms && \ | |
yum install -y devtoolset-8 | |
- name: Install CMake and Zlib | |
run: | | |
yum install -y cmake3 zlib-devel | |
ln -s /usr/bin/cmake3 /usr/bin/cmake | |
- name: Build ITK | |
run: | | |
export CC=/opt/rh/devtoolset-8/root/usr/bin/gcc | |
export CXX=/opt/rh/devtoolset-8/root/usr/bin/g++ | |
mkdir ITK-build | |
cd ITK-build | |
cmake \ | |
-DBUILD_SHARED_LIBS=OFF \ | |
-DBUILD_TESTING=OFF \ | |
-DBUILD_EXAMPLES=OFF \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=../ITK-install \ | |
../ITK | |
make install | |
cd .. | |
- name: Build samseg and run tests | |
run: | | |
export CC=/opt/rh/devtoolset-8/root/usr/bin/gcc | |
export CXX=/opt/rh/devtoolset-8/root/usr/bin/g++ | |
.github/workflows/linux_build.sh /opt/python/cp38-cp38/bin/python | |
.github/workflows/linux_build.sh /opt/python/cp39-cp39/bin/python | |
.github/workflows/linux_build.sh /opt/python/cp310-cp310/bin/python | |
.github/workflows/linux_build.sh /opt/python/cp311-cp311/bin/python | |
ls dist/*.whl | xargs -n1 auditwheel repair | |
env: | |
ITK_DIR: ITK-install | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: linux-wheels | |
path: wheelhouse/*.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 wheelhouse/*.whl -u __token__ -p "$PASSWORD" | |
env: | |
PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
PYTHON: /opt/python/cp38-cp38/bin/python |