release 0.3.5 #59
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Python wheels and publish | |
# Controls when the workflow will run | |
on: | |
# run pipeline on push event of main or release branch | |
push: | |
branches: | |
- 'test/**' | |
- 'release/**' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build-and-test-python: | |
strategy: | |
matrix: | |
platform: [linux, macos, windows] | |
include: | |
- platform: linux | |
os: ubuntu-latest | |
archs: "aarch64 x86_64" | |
- platform: macos | |
os: macos-latest | |
archs: "x86_64 arm64" | |
- platform: windows | |
os: windows-latest | |
archs: AMD64 | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_ENVIRONMENT_WINDOWS: SETUPTOOLS_USE_DISTUTILS=stdlib | |
CIBW_SKIP: "pp3* *-musllinux_*" | |
CIBW_ARCHS: ${{ matrix.archs }} | |
CIBW_TEST_REQUIRES: pytest pandas | |
CIBW_TEST_COMMAND: pytest -ra --capture=no --showlocals {package}/tests | |
steps: | |
- uses: actions/checkout@v3 | |
# install QEMU for building aarch64 wheels on linux | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
# cibuildwheel builds wheels for many different versions of Python and OS: | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- name: Keep wheel files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheelhouse | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
publish-wheels: | |
needs: [build-and-test-python, build_sdist] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
architecture: x64 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheelhouse | |
path: wheelhouse | |
- name: List assets | |
run: | | |
ls ./wheelhouse/* -al | |
- name: Upload wheels to test PyPI | |
if: (github.event_name == 'push') || (github.event_name == 'workflow_dispatch') | |
run: | | |
pip install twine | |
echo "Publish to Test PyPI..." | |
twine upload --verbose --skip-existing --repository testpypi wheelhouse/* | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_TEST_USER }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASS }} | |
- name: Upload wheels to official PyPI | |
if: contains(github.ref, 'release') && ((github.event_name == 'push') || (github.event_name == 'workflow_dispatch')) | |
run: | | |
pip install twine | |
echo "Publish to PyPI..." | |
twine upload --verbose --skip-existing wheelhouse/* | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USER }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }} |