Skip to content

chore: update buildext #142

chore: update buildext

chore: update buildext #142

Workflow file for this run

name: Build
on:
push:
branches:
- master
tags:
- "v*"
pull_request:
branches:
- master
permissions:
contents: read
env:
PYICU_VERSION: "2.15.2"
LIBICU_VERSION: "77"
jobs:
linux:
name: Linux wheels (${{ matrix.cpy }}-${{ matrix.platform }}_${{ matrix.arch }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- "x86_64"
- "aarch64"
- "i686"
- "ppc64le"
cpy:
- "cp310"
- "cp311"
- "cp312"
- "cp313"
- "cp314"
- "cp314t"
platform:
- "manylinux"
- "musllinux"
env:
_LIBICU_DIR: "/host/tmp/.build"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Hatch
run: pip install --upgrade hatch
- name: Cache pyicu
id: cache-pyicu
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/pyicu
key: ${{ runner.os }}-pyicu-${{ env.PYICU_VERSION }}
- name: Fetch pyicu source
if: steps.cache-pyicu.outputs.cache-hit != 'true'
run: hatch run pyicu:clone
- name: Copy src and tests
run: |
hatch run pyicu:src
hatch run pyicu:tests
- name: Cache libicu
id: cache-libicu
uses: actions/cache@v4
with:
path: "/tmp/.build"
key: libicu-${{ matrix.platform }}-${{ matrix.arch }}-${{ env.LIBICU_VERSION }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
# See https://github.com/pypa/cibuildwheel/discussions/2256
image: tonistiigi/binfmt:qemu-v8.1.5
- name: Build wheels
uses: pypa/cibuildwheel@v3.2.0
env:
CIBW_BUILD: ${{ matrix.cpy }}-${{ matrix.platform }}_${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
name: cibw-linux-${{ matrix.cpy }}-${{ matrix.platform }}_${{ matrix.arch }}
path: ./wheelhouse/*.whl
macos:
name: macOS wheels (${{ matrix.cpy }}-macosx_${{ matrix.macos }}_${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
arch:
- "x86_64"
- "arm64"
cpy:
- "cp310"
- "cp311"
- "cp312"
- "cp313"
- "cp314"
- "cp314t"
include:
- arch: "x86_64"
macos: 15
brew: "/usr/local/opt"
runner: "macos-15-intel"
- arch: "arm64"
macos: 15
brew: "/opt/homebrew/opt"
runner: "macos-15"
steps:
- uses: actions/checkout@v4
- name: Install Hatch
run: pip install --upgrade hatch
- name: Cache pyicu
id: cache-pyicu
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/pyicu
key: ${{ runner.os }}-pyicu-${{ env.PYICU_VERSION }}
- name: Fetch pyicu source
if: steps.cache-pyicu.outputs.cache-hit != 'true'
run: hatch run pyicu:clone
- name: Copy src and tests
run: |
hatch run pyicu:src
hatch run pyicu:tests
- name: Install build dependencies
run: |
brew update
brew install icu4c@${{ env.LIBICU_VERSION }}
- name: Build wheels
uses: pypa/cibuildwheel@v3.2.0
env:
CIBW_BUILD: ${{ matrix.cpy }}-macosx_${{ matrix.arch }}
CIBW_ARCHS_MACOS: ${{matrix.arch}}
CIBW_ENVIRONMENT: >-
MACOSX_DEPLOYMENT_TARGET="${{ matrix.macos }}.0"
_LIBICU_DIR="${{ matrix.brew }}/icu4c@${{ env.LIBICU_VERSION }}"
- uses: actions/upload-artifact@v4
with:
name: cibw-macos-${{ matrix.macos }}-${{ matrix.cpy }}-macosx_${{ matrix.arch }}
path: ./wheelhouse/*.whl
publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
name: Publish wheels
runs-on: ubuntu-latest
needs:
- linux
- macos
environment:
name: release
url: https://pypi.org/project/pyicu-wheels
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1