|
- name: release-python
- on:
- push:
- tags:
- - '*'
-
- jobs:
- build_sdist:
- name: Build SDist
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- with:
- submodules: true
-
- - uses: actions/setup-python@v2
-
- - name: Install deps
- run: python -m pip install twine build
-
- - name: Build SDist
- run: python -m build -s
-
- - name: Check metadata
- run: twine check dist/*
-
- - uses: actions/upload-artifact@v2
- with:
- path: dist/*.tar.gz
-
-
- build_wheels:
- name: Build wheels on ${{ matrix.os }}
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-20.04, windows-2019, macos-10.15]
-
- steps:
- - uses: actions/checkout@v2
- with:
- submodules: true
-
- - uses: actions/setup-python@v2
-
- - name: Build wheels
- uses: pypa/cibuildwheel@v2.3.1
- env:
- CIBW_ARCHS_MACOS: x86_64 universal2 arm64
- CIBW_ARCHS_LINUX: x86_64 i686
-
- - name: Show files
- run: ls -lh wheelhouse
- shell: bash
-
- - name: Verify clean directory
- run: git diff --exit-code
- shell: bash
-
- - name: Upload wheels
- uses: actions/upload-artifact@v2
- with:
- path: wheelhouse/*.whl
-
- build_wheels_qemu:
- name: Build wheels ${{ matrix.arch }} ${{ matrix.build }}
- runs-on: ubuntu-20.04
-
- strategy:
- fail-fast: false
- matrix:
- arch: [aarch64, ppc64le, s390x]
- build: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"]
- include:
- - arch: aarch64
- build: "pp37-*"
- - arch: aarch64
- build: "pp38-*"
-
- steps:
- - uses: actions/checkout@v2
- with:
- submodules: true
-
- - uses: actions/setup-python@v2
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
- with:
- platforms: all
-
- - name: Build wheels
- uses: pypa/cibuildwheel@v2.3.1
- env:
- CIBW_ARCHS_LINUX: ${{ matrix.arch }}
- CIBW_BUILD: ${{ matrix.build }}
-
- - name: Show files
- run: ls -lh wheelhouse
- shell: bash
-
- - name: Verify clean directory
- run: git diff --exit-code
- shell: bash
-
- - name: Upload wheels
- uses: actions/upload-artifact@v2
- with:
- path: wheelhouse/*.whl
-
- upload_all:
- name: Upload
- needs: [build_wheels, build_wheels_qemu, build_sdist]
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/setup-python@v2
-
- - uses: actions/download-artifact@v2
- with:
- name: artifact
- path: dist
-
- - uses: pypa/gh-action-pypi-publish@v1.4.2
- with:
- user: __token__
- password: ${{ secrets.PYPI_API_TOKEN }}
|