Skip to content

fix

fix #4

Workflow file for this run

name: Build Python Wheels
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build-wheels:
name: Build Python Wheels (${{ matrix.OS }})
strategy:
fail-fast: false
matrix:
OS: ["ubuntu-24.04", "windows-2022"]
runs-on: ${{ matrix.OS }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
show-progress: true
- name: Resolve release version
if: github.event_name == 'release'
id: release_version
shell: bash
run: |
tag="${GITHUB_REF_NAME}"
echo "value=${tag#v}" >> "$GITHUB_OUTPUT"
- name: Set version for release
if: github.event_name == 'release'
shell: bash
run: |
python - <<'PY'
from pathlib import Path
path = Path("pyproject.toml")
data = path.read_text(encoding="utf-8")
version = "${{ steps.release_version.outputs.value }}"
old = 'version = "0.1.0"'
new = f'version = "{version}"'
if old not in data:
raise SystemExit('Expected version string not found in pyproject.toml')
data = data.replace(old, new, 1)
path.write_text(data, encoding="utf-8")
PY
- name: Build wheels
uses: pypa/cibuildwheel@v3.1.0
with:
output-dir: wheelhouse
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheelhouse-${{ matrix.OS }}
path: wheelhouse/*.whl