fix: correct Python version format for cibuildwheel #10
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 Wheels | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
include: | |
# Linux builds | |
- os: ubuntu-latest | |
python-version: '3.10' | |
cp_version: '310' | |
- os: ubuntu-latest | |
python-version: '3.11' | |
cp_version: '311' | |
- os: ubuntu-latest | |
python-version: '3.12' | |
cp_version: '312' | |
# Windows builds | |
- os: windows-latest | |
python-version: '3.10' | |
cp_version: '310' | |
- os: windows-latest | |
python-version: '3.11' | |
cp_version: '311' | |
- os: windows-latest | |
python-version: '3.12' | |
cp_version: '312' | |
# macOS builds | |
- os: macos-latest | |
python-version: '3.10' | |
cp_version: '310' | |
arch: x86_64 | |
- os: macos-latest | |
python-version: '3.11' | |
cp_version: '311' | |
arch: x86_64 | |
- os: macos-latest | |
python-version: '3.12' | |
cp_version: '312' | |
arch: x86_64 | |
- os: macos-latest | |
python-version: '3.10' | |
cp_version: '310' | |
arch: arm64 | |
- os: macos-latest | |
python-version: '3.11' | |
cp_version: '311' | |
arch: arm64 | |
- os: macos-latest | |
python-version: '3.12' | |
cp_version: '312' | |
arch: arm64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel | |
shell: bash | |
- name: Build wheels | |
env: | |
CIBW_BUILD: cp${{ matrix.cp_version }}-* | |
CIBW_ARCHS: all | |
CIBW_BEFORE_BUILD: pip install poetry && poetry install --all-extras | |
CIBW_ENVIRONMENT: INCLUDE_DEPS=1 | |
run: python -m cibuildwheel --output-dir dist | |
shell: bash | |
- name: Build source distribution | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' | |
run: python -m build --sdist --outdir dist/ | |
shell: bash | |
- name: Upload to GitHub Actions | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.os }}-${{ matrix.arch }}-py${{ matrix.python-version }} | |
path: dist/* | |
release: | |
needs: build_wheels | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
permissions: | |
contents: write | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: dist-* | |
path: dist | |
merge-multiple: true | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* |