From 70ec3e36e31c2200ce07986aaab43f3584dd239a Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 7 Oct 2021 00:50:47 -0400 Subject: [PATCH] Attempt to improve GH Actions wheel building --- .github/workflows/build-linux-wheels.yml | 47 -------------------- .github/workflows/build-macos-wheels.yml | 35 --------------- .github/workflows/build-wheels.yml | 73 ++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/build-linux-wheels.yml delete mode 100644 .github/workflows/build-macos-wheels.yml create mode 100644 .github/workflows/build-wheels.yml diff --git a/.github/workflows/build-linux-wheels.yml b/.github/workflows/build-linux-wheels.yml deleted file mode 100644 index 049cf40..0000000 --- a/.github/workflows/build-linux-wheels.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Build manylinux1 wheels - -on: push - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build manylinux1 Python wheels - uses: RalfG/python-wheels-manylinux-build@e645ea95dae94f606ab25f95f44d3a2caf55764c - with: - python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' - pip-wheel-args: '-w ./wheelhouse --no-deps' - - name: Move to dist/ - run: | - mkdir -p dist - cp -v wheelhouse/*-manylinux*.whl dist/ - - name: Publish package to PyPI - # Only actually publish if a new tag was pushed - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@37e305e7413032d8422456179fee28fac7d25187 - with: - user: __token__ - password: ${{ secrets.pypi_password }} - build_aarch64: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: docker/setup-qemu-action@v1 - name: Set up QEMU - - name: Build manylinux aarch64 Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.3.4-manylinux2014_aarch64 - with: - python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' - pip-wheel-args: '-w ./wheelhouse --no-deps' - - name: Move to dist/ - run: | - mkdir -p dist - cp -v wheelhouse/*-manylinux*.whl dist/ - - name: Publish package to PyPI - # Only actually publish if a new tag was pushed - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@37e305e7413032d8422456179fee28fac7d25187 - with: - user: __token__ - password: ${{ secrets.pypi_password }} diff --git a/.github/workflows/build-macos-wheels.yml b/.github/workflows/build-macos-wheels.yml deleted file mode 100644 index fed6aaa..0000000 --- a/.github/workflows/build-macos-wheels.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build macOS wheels - -on: push - -jobs: - build: - runs-on: macos-latest - strategy: - matrix: - python-version: - - '3.6' - - '3.7' - - '3.8' - - '3.9' - - '3.10' - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Build wheels - run: | - python -m pip install --upgrade pip wheel setuptools - pip wheel . -w dist/ - ls dist/ - - name: Publish package to PyPI - # Only actually publish if a new tag was pushed - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - # We can't use the pypa action because of https://github.com/pypa/gh-action-pypi-publish/issues/15 - run: | - pip install twine - TWINE_USERNAME="__token__" \ - TWINE_PASSWORD="${{ secrets.pypi_password }}" \ - twine upload dist/* diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 0000000..9077bb4 --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -0,0 +1,73 @@ +name: Build wheels + +on: push + +jobs: + build-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Build manylinux1 x86-64 wheels + uses: RalfG/python-wheels-manylinux-build@v0.3.4-manylinux1_x86_64 + with: + python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39' + pip-wheel-args: '-w ./wheelhouse --no-deps' + - name: Build manylinux2014 x86-64 wheels + uses: RalfG/python-wheels-manylinux-build@v0.3.4-manylinux2014_x86_64 + with: + python-versions: 'cp310-cp310' + pip-wheel-args: '-w ./wheelhouse --no-deps' + - name: Build manylinux 2014 aarch64 wheels + uses: RalfG/python-wheels-manylinux-build@v0.3.4-manylinux2014_aarch64 + with: + python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' + pip-wheel-args: '-w ./wheelhouse --no-deps' + - name: Move to dist/ + run: | + mkdir -p dist + cp -v wheelhouse/*-manylinux*.whl dist/ + - uses: actions/upload-artifact@v2 + with: + path: wheelhouse/*-manylinux*.whl + - name: Publish package to PyPI + # Only actually publish if a new tag was pushed + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@37e305e7413032d8422456179fee28fac7d25187 + with: + user: __token__ + password: ${{ secrets.pypi_password }} + + build-macos: + runs-on: macos-latest + strategy: + matrix: + python-version: + - '3.6' + - '3.7' + - '3.8' + - '3.9' + - '3.10' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Build wheels + run: | + python -m pip install --upgrade pip wheel setuptools + pip wheel . -w dist/ + ls dist/ + - uses: actions/upload-artifact@v2 + with: + path: dist/*.whl + - name: Publish package to PyPI + # Only actually publish if a new tag was pushed + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + # We can't use the pypa action because of https://github.com/pypa/gh-action-pypi-publish/issues/15 + run: | + pip install twine + TWINE_USERNAME="__token__" \ + TWINE_PASSWORD="${{ secrets.pypi_password }}" \ + twine upload dist/*