Skip to content

Create release

Create release #15

Workflow file for this run

on:
release:
types:
- published
name: Create release
jobs:
# Build & test simple source release before wasting hours building and
# testing the binary build matrix.
sdist:
name: Creating source release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setting up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Installing python build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
- name: Building source distribution
run: |
pip install -e ".[test,release]"
python setup.py sdist
- name: Running tests
run: |
pytest
- name: Ensuring documentation builds
run: |
cd docs && make clean && make html
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels:
needs: [sdist]
name: "[${{ strategy.job-index }}/${{ strategy.job-total }}] py${{ matrix.py }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
py: ["cp38", "cp39", "cp310", "cp311", "cp312", "pp38", "pp39", "pp310"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Setting up Python
with:
python-version: '3.8'
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/[email protected]
with:
platforms: all
- name: Build & test wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_BUILD: "${{ matrix.py }}-*"
CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64"
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
upload_all:
needs: [build_wheels, sdist]
name: Uploading built packages to pypi for release.
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
build_documentation:
name: Building & uploading documentation.
needs: [upload_all]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setting up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Installing python build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
- name: Installing release dependencies.
run: |
pip install -e ".[test,release]"
- name: Building documentation
run: |
cd docs && make clean && make html
- name: Publishing documentation
run: |
ghp-import -f -n -p docs/_build/html