Bump version: 0.2.3 → 0.2.4 #57
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: release | |
on: | |
pull_request: | |
push: | |
tags: | |
- v* | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build-wheels: | |
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
runs-on: ${{ matrix.buildplat[0] }} | |
strategy: | |
# Ensure that a wheel builder finishes even if another fails | |
fail-fast: false | |
matrix: | |
# Github Actions doesn't support pairing matrix values together, let's improvise | |
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026 | |
buildplat: | |
- [ubuntu-20.04, manylinux_x86_64] | |
- [macos-12, macosx_*] | |
- [windows-2019, win_amd64] | |
- [windows-2019, win32] | |
python: ["cp38", "cp39", "cp310", "cp311", "cp312"] | |
env: | |
IS_32_BIT: ${{ matrix.buildplat[1] == 'win32' }} | |
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} | |
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
steps: | |
- name: Checkout fuzzyset | |
uses: actions/checkout@v4 | |
# Used to push the built wheels | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: setup rtools for 32-bit | |
run: | | |
echo "PLAT=i686" >> $env:GITHUB_ENV | |
echo "PATH=$env:RTOOLS40_HOME\mingw32\bin;$env:PATH" >> $env:GITHUB_ENV | |
gfortran --version | |
if: ${{ matrix.buildplat[1] == 'win32' }} | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pypi-wheel-${{ matrix.python }}-${{ matrix.buildplat[0] }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
build-sdist: | |
name: Build sdist | |
runs-on: ubuntu-latest | |
env: | |
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} | |
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
steps: | |
- name: Checkout fuzzyset | |
uses: actions/checkout@v4 | |
# Used to push the built wheels | |
- uses: actions/setup-python@v5 | |
with: | |
# Build sdist on lowest supported Python | |
python-version: "3.x" | |
- name: Build sdist | |
run: | | |
python -m pip install --upgrade pip setuptools | |
python -m pip install build twine wheel cython | |
python -m build --sdist | |
- name: Test the sdist | |
run: | | |
# TODO: Don't run test suite, and instead build wheels from sdist | |
# Depends on pypa/cibuildwheel#1020 | |
python -m pip install dist/*.gz | |
pip install pytest | |
pytest | |
- name: Check README rendering for PyPI | |
run: | | |
twine check dist/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pypi-src | |
path: ./dist/*.tar.gz | |
upload: | |
needs: [build-wheels, build-sdist] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
permissions: | |
# short-lived token for trusted publishing | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Stage artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
pattern: pypi-* | |
merge-multiple: true | |
- name: List all artifacts | |
run: ls -R | |
- name: Upload with twine | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: artifact/ | |