Skip to content

update

update #2

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: Build wheels (release version)
if: github.event_name == 'release'
uses: pypa/cibuildwheel@v3.1.0
env:
CIBW_BUILD_FRONTEND: "build"
CIBW_BUILD_FRONTEND_ARGS: >-
--config-setting=metadata={"version":"${{ steps.release_version.outputs.value }}"}
with:
output-dir: wheelhouse
- name: Build wheels (PR)
if: github.event_name != 'release'
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