use kickmaker's git on pypi #25
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 and upload to PyPI | |
on: [push, pull_request] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-2019, macos-12] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v1 | |
with: | |
platforms: all | |
- name: Build wheels | |
uses: pypa/[email protected] | |
# to supply options, put them in 'env', like: | |
env: | |
# configure cibuildwheel to build native archs ('auto'), and some | |
# emulated ones | |
CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x | |
CIBW_ARCHS_MACOS: x86_64 universal2 arm64 | |
CIBW_TEST_COMMAND: python -c "import bsdiffhs; assert bsdiffhs.test().wasSuccessful()" | |
# heatshrink2 dependency suffers from "import array" issue and shall be replaced by char* | |
# https://github.com/h5py/h5py/pull/1515 | |
# avoid on pypy | |
CIBW_SKIP: pp* cp36* | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
# upload to PyPI on every tag | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_BSDIFFHS_TOKEN }} | |
release_github: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
# Create release on every tag | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/create-release@v1 | |
id: create_release | |
with: | |
draft: false | |
prerelease: false | |
release_name: release_${{ github.ref }} | |
tag_name: ${{ github.ref }} | |
body_path: CHANGELOG.md | |
env: | |
GITHUB_TOKEN: ${{ github.token }} |