From 0058f027d91a2307a89aadc5114befe809856684 Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Tue, 22 Dec 2020 08:54:03 -0600 Subject: [PATCH] fetch artifacts for dist upload (#174) * fetch artifacts for dist upload * ymal syntax --- .github/workflows/build.yml | 66 +++++++++++++++++++++++++++++++++++- .github/workflows/wheels.yml | 56 ------------------------------ rtree/__init__.py | 2 +- 3 files changed, 66 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/wheels.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5a5767d..e4d6c614 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -112,12 +112,54 @@ jobs: make latexpdf working-directory: ./docs + wheels: + name: Build wheel on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + env: + CIBW_SKIP: pp* *-win32 + CIBW_TEST_REQUIRES: pytest numpy + CIBW_TEST_COMMAND: "pytest -v {project}/tests" + # we are copying the shared libraries ourselves so skip magical copy + CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" + CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "" + CIBW_BEFORE_BUILD_LINUX: "pip install cmake; bash {project}/ci/install_libspatialindex.bash" + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + name: Install Python + with: + python-version: '3.7' + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==1.6.4 + - name: Run MacOS Preinstall Build + if: startsWith(matrix.os, 'macos') + run: | + # provides sha256sum + brew install coreutils + pip install cmake + bash ci/install_libspatialindex.bash + - name: Run Windows Preinstall Build + if: startsWith(matrix.os, 'windows') + run: | + choco install vcpython27 -f -y + ci\install_libspatialindex.bat + - name: Build wheels + run: | + python -m cibuildwheel --output-dir wheelhouse + - uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.os }}-whl + path: wheelhouse/*.whl collect-artifacts: name: Package and push release #needs: [windows-wheel, linux-wheel, osx-wheel, conda, ubuntu] - needs: [conda, ubuntu] + needs: [conda, ubuntu, wheels] runs-on: 'ubuntu-latest' strategy: @@ -134,6 +176,28 @@ jobs: export PATH=$PATH:/home/runner/.local/bin python3 setup.py sdist + - uses: actions/download-artifact@v2 + with: + path: dist + name: Download artifacts + + - name: Display structure of downloaded files + run: ls -R + working-directory: dist + + - name: Unpack + shell: bash -l {0} + working-directory: dist + run: | + for f in *whl + do + cd "$f" + cp *.whl .. + cd .. + done; + rm -rf *\-whl + ls -al + - uses: pypa/gh-action-pypi-publish@master name: Publish package if: github.event_name == 'release' && github.event.action == 'published' diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml deleted file mode 100644 index a6761fb4..00000000 --- a/.github/workflows/wheels.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Build Wheels - -on: [push, pull_request] - -jobs: - build_wheels: - name: Build wheel on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - env: - CIBW_SKIP: pp* *-win32 - CIBW_TEST_REQUIRES: pytest numpy - CIBW_TEST_COMMAND: "pytest -v {project}/tests" - # we are copying the shared libraries ourselves so skip magical copy - CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" - CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "" - CIBW_BEFORE_BUILD_LINUX: "pip install cmake; bash {project}/ci/install_libspatialindex.bash" - strategy: - matrix: - os: [windows-latest, ubuntu-latest, macos-latest] - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-python@v1 - name: Install Python - with: - python-version: '3.7' - - name: Install cibuildwheel - run: | - python -m pip install cibuildwheel==1.6.4 - - name: Run MacOS Preinstall Build - if: startsWith(matrix.os, 'macos') - run: | - # provides sha256sum - brew install coreutils - pip install cmake - bash ci/install_libspatialindex.bash - - name: Run Windows Preinstall Build - if: startsWith(matrix.os, 'windows') - run: | - choco install vcpython27 -f -y - ci\install_libspatialindex.bat - - name: Build wheels - run: | - python -m cibuildwheel --output-dir wheelhouse - - uses: actions/upload-artifact@v1 - with: - name: wheels - path: ./wheelhouse - - name: Upload To PyPi - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - # TODO : remove `if false` statement after secrets are set in Github UI - if: false - run: | - pip install twine - twine upload ./wheelhouse/* diff --git a/rtree/__init__.py b/rtree/__init__.py index bc08c1f0..75cce3ab 100644 --- a/rtree/__init__.py +++ b/rtree/__init__.py @@ -4,6 +4,6 @@ Rtree provides Python bindings to libspatialindex for quick hyperrectangular intersection queries. """ -__version__ = '0.9.5' +__version__ = '0.9.6' from .index import Rtree, Index # noqa