diff --git a/.github/workflows/publish-sdist-wheels.yml b/.github/workflows/publish-sdist-wheels.yml new file mode 100644 index 00000000..5af04c8b --- /dev/null +++ b/.github/workflows/publish-sdist-wheels.yml @@ -0,0 +1,95 @@ +name: Publish sdist and wheels macos-manylinux + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +env: + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + MACOSX_DEPLOYMENT_TARGET: '10.13' + CIBW_BUILD_VERBOSITY: 2 + # Only build on Python 3.x + CIBW_BUILD: 'cp3?-*' + CIBW_SKIP: 'cp35-* cp39-* *-manylinux_i686' + CIBW_BEFORE_TEST: pip install nose mock + CIBW_TEST_COMMAND: nosetests -s -v -P {project}/python/tests + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, macos-latest] + + steps: + - uses: actions/checkout@v2 + with: + submodules: 'true' + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.7' + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==1.6.4 + - name: Build wheels on Linux + if: runner.os == 'Linux' + env: + CIBW_BEFORE_BUILD: 'yum update -y; yum -y install hdf5-devel' + run: | + python -m cibuildwheel --output-dir dist + - name: Build wheels Mac OS + if: runner.os == 'macOS' + env: + CIBW_BEFORE_BUILD: 'brew update; brew install cmake hdf5' + run: | + python -m cibuildwheel --output-dir dist + - name: Store wheel as artifact + uses: actions/upload-artifact@v2 + with: + name: dist + path: dist + + build_sdist: + name: Build sdist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + - name: Build a source tarball + run: + python setup.py sdist + - name: Store sdist as artifact + uses: actions/upload-artifact@v2 + with: + name: dist + path: dist + + upload_wheels: + runs-on: ubuntu-latest + needs: [build_wheels, build_sdist] + name: Upload wheels to PyPI + steps: + - name: Download artifacts produced during the build_wheels and build_sdist jobs + uses: actions/download-artifact@v2 + with: + name: dist + path: dist + + - name: Display structure of downloaded files + run: ls -R + working-directory: dist + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} + packages_dir: dist/