perf(ci): use cibuildwheel preferably #1
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: Wheels | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
release: | ||
types: | ||
- published | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-wheels | ||
cancel-in-progress: true | ||
env: | ||
FORCE_COLOR: 3 | ||
jobs: | ||
build_sdist: | ||
name: Build SDist | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Build SDist | ||
run: pipx run build --sdist | ||
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/*.tar.gz | ||
build_wheels: | ||
name: Build ${{ matrix.arch }} wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
arch: [aarch64, ppc64le, s390x, armv7l, x86_64, i686] | ||
os: [ubuntu-24.04] # renovate: github-runner | ||
use_qemu: [aarch64 ppc64le s390x armv7l] | ||
include: | ||
- os: windows-2019 | ||
arch: AMD64 | ||
- os: windows-2019 | ||
arch: x86 | ||
#- os: windows-2022 | ||
arch: ARM64 | ||
- os: macos-13 | ||
arch: x86_64 | ||
- os: macos-latest | ||
arch: arm64 | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up msvc on Windows | ||
if: runner.os == 'Windows' | ||
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1 | ||
with: | ||
arch: ${{ matrix.arch }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 | ||
if: runner.os == 'Linux' && contains(matrix.use_qemu, matrix.arch) | ||
- name: Build wheels | ||
uses: pypa/cibuildwheel@ee63bf16da6cddfb925f542f2c7b59ad50e93969 # v2.22.0 | ||
env: | ||
CIBW_ARCHS: ${{ matrix.arch }} | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | ||
with: | ||
name: cibw-${{ matrix.os }}-${{ matrix.arch }} | ||
path: wheelhouse/*.whl | ||
upload_all: | ||
needs: [build_wheels, build_sdist] | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | ||
with: | ||
pattern: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
env: | ||
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |