diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml new file mode 100644 index 0000000..4c85cd2 --- /dev/null +++ b/.github/workflows/publish_pypi.yml @@ -0,0 +1,78 @@ +name: Publish to PyPi + +on: + release: + types: [published] + + workflow_dispatch: + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + env: + MACOSX_DEPLOYMENT_TARGET: "10.15" + strategy: + matrix: + os: [ubuntu-20.04, macos-11, windows-latest] + cibw_archs: ["auto64"] + cibw_build: ["cp38-*", "cp39-*", "cp310-*", "cp311-*"] + + steps: + - uses: actions/checkout@v3 + name: Check out + with: + submodules: recursive + + - uses: ilammy/msvc-dev-cmd@v1 + name: Add MSVS Path + + - uses: ilammy/setup-nasm@v1 + name: Add NASM + + - uses: actions/setup-python@v4 + name: Install Python + with: + python-version: '3.9' + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==2.16.2 delvewheel wheel + + - name: Building wheels + run: | + python -m cibuildwheel --output-dir dist + env: + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_BUILD_VERBOSITY: 3 + CIBW_SKIP: "*musllinux*" + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_BEFORE_ALL_MACOS: brew install llvm libomp nasm && + bash ci-utils/install_prereq_linux.sh && + mkdir -p /tmp/argolid_bld && + cp -r local_install /tmp/argolid_bld + CIBW_BEFORE_ALL_LINUX: curl -L http://mirror.centos.org/centos/8-stream/PowerTools/x86_64/os/Packages/nasm-2.15.03-3.el8.x86_64.rpm -o nasm-2.15.03-3.el8.x86_64.rpm && + yum -y install nasm-2.15.03-3.el8.x86_64.rpm && + bash ci-utils/install_prereq_linux.sh && + mkdir -p /tmp/argolid_bld && + cp -r local_install /tmp/argolid_bld + CIBW_BEFORE_ALL_WINDOWS: ci-utils\install_prereq_win.bat && + xcopy /E /I /y local_install C:\TEMP\argolid_bld\local_install + CIBW_ENVIRONMENT_MACOS: REPAIR_LIBRARY_PATH="/tmp/argolid_bld/local_install/lib:/tmp/argolid_bld/local_install/lib64" ON_GITHUB="TRUE" PATH="$(brew --prefix llvm)/bin:$PATH" COMPILER="/usr/local/opt/llvm/bin/clang++" CFLAGS="-I /usr/local/include -I/usr/local/opt/llvm/include" CXXFLAGS="-I /usr/local/include -I/usr/local/opt/llvm/include" LDFLAGS="-L /usr/local/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib" CXX="/usr/local/opt/llvm/bin/clang++" CC="/usr/local/opt/llvm/bin/clang" ARGOLID_DEP_DIR="/tmp/argolid_bld/local_install" + CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH="/tmp/argolid_bld/local_install/lib:/tmp/argolid_bld/local_install/lib64:$LD_LIBRARY_PATH" ON_GITHUB="TRUE" ARGOLID_DEP_DIR="/tmp/argolid_bld/local_install" + CIBW_REPAIR_WHEEL_COMMAND_MACOS: DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-listdeps {wheel} && DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel} + CIBW_ENVIRONMENT_WINDOWS: PATH="$TEMP\\argolid\\bin;$PATH" ON_GITHUB="TRUE" ARGOLID_DEP_DIR="C:\\TEMP\\argolid_bld\\local_install" + CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" + CIBW_ARCHS: ${{ matrix.cibw_archs }} + CIBW_TEST_REQUIRES: bfio==2.3.2 tensorstore + CIBW_TEST_COMMAND: python -W default -m unittest discover -s {project}/tests -v + + - name: Install Dependencies + run: python -m pip install --upgrade twine requests + + - name: Publish to PyPi + run: python -m twine upload dist/*.whl + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + TWINE_REPOSITORY: pypi \ No newline at end of file diff --git a/.github/workflows/wheel_build.yml b/.github/workflows/wheel_build.yml index 1ff091f..139a0f6 100644 --- a/.github/workflows/wheel_build.yml +++ b/.github/workflows/wheel_build.yml @@ -35,7 +35,7 @@ jobs: - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.12.1 delvewheel wheel + python -m pip install cibuildwheel==2.16.2 delvewheel wheel - name: Building wheels run: | diff --git a/ci-utils/install_prereq_linux.sh b/ci-utils/install_prereq_linux.sh index 70bb6f2..55f4c21 100755 --- a/ci-utils/install_prereq_linux.sh +++ b/ci-utils/install_prereq_linux.sh @@ -14,9 +14,9 @@ fi mkdir -p $LOCAL_INSTALL_DIR mkdir -p $LOCAL_INSTALL_DIR/include -curl -L https://github.com/PolusAI/filepattern/archive/refs/tags/v2.0.3.zip -o v2.0.3.zip -unzip v2.0.3.zip -cd filepattern-2.0.3 +curl -L https://github.com/PolusAI/filepattern/archive/refs/tags/v2.0.4.zip -o v2.0.4.zip +unzip v2.0.4.zip +cd filepattern-2.0.4 mkdir build cd build cmake -Dfilepattern_SHARED_LIB=ON -DCMAKE_PREFIX_PATH=../../$LOCAL_INSTALL_DIR -DCMAKE_INSTALL_PREFIX=../../$LOCAL_INSTALL_DIR ../src/filepattern/cpp diff --git a/ci-utils/install_prereq_win.bat b/ci-utils/install_prereq_win.bat index 753bb2e..626e43e 100644 --- a/ci-utils/install_prereq_win.bat +++ b/ci-utils/install_prereq_win.bat @@ -1,9 +1,9 @@ mkdir local_install mkdir local_install\include -curl -L https://github.com/PolusAI/filepattern/archive/refs/tags/v2.0.3.zip -o v2.0.3.zip -tar -xvf v2.0.3.zip -pushd filepattern-2.0.3 +curl -L https://github.com/PolusAI/filepattern/archive/refs/tags/v2.0.4.zip -o v2.0.4.zip +tar -xvf v2.0.4.zip +pushd filepattern-2.0.4 mkdir build pushd build cmake -Dfilepattern_SHARED_LIB=ON -DCMAKE_PREFIX_PATH=../../local_install -DCMAKE_INSTALL_PREFIX=../../local_install ../src/filepattern/cpp diff --git a/src/chunked_pyramid_assembler.cpp b/src/chunked_pyramid_assembler.cpp index 0825bf2..25d244d 100644 --- a/src/chunked_pyramid_assembler.cpp +++ b/src/chunked_pyramid_assembler.cpp @@ -205,7 +205,8 @@ void OmeTiffCollToChunked::GenerateOmeXML(const std::string& image_name, const s // Add the namespaces and attributes to the root element omeNode.append_attribute("xmlns") = "http://www.openmicroscopy.org/Schemas/OME/2016-06"; omeNode.append_attribute("xmlns:xsi") = "http://www.w3.org/2001/XMLSchema-instance"; - omeNode.append_attribute("Creator") = "Argolid 0.0.1"; + auto creator = std::string{"Argolid "} + std::string{VERSION_INFO}; + omeNode.append_attribute("Creator") = creator.c_str(); omeNode.append_attribute("UUID") = "urn:uuid:ce3367ae-0512-4e87-a045-20d87db14001"; omeNode.append_attribute("xsi:schemaLocation") = "http://www.openmicroscopy.org/Schemas/OME/2016-06 http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd";