Skip to content

✨ 为渲染函数补齐 dpi 参数 (#2) #4

✨ 为渲染函数补齐 dpi 参数 (#2)

✨ 为渲染函数补齐 dpi 参数 (#2) #4

Workflow file for this run

name: Build Wheels
on:
push:
workflow_dispatch:
pull_request:
branches:
- master
jobs:
build_macosx:
name: Build wheel for ${{ matrix.python }}-macosx_arm64
runs-on: macos-14
strategy:
fail-fast: false
matrix:
python: [cp310, cp312, cp313t, cp314t]
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
cache-suffix: ${{ matrix.python }}-macosx_arm64
cache-dependency-glob: uv.lock
- name: Install Xmake
run: brew install xmake
- name: Cache Xmake
uses: actions/cache@v4
with:
path: ~/.xmake
key: xmake-macosx_arm64-${{ hashFiles('xmake.lua') }}
- name: Build wheel
uses: pypa/cibuildwheel@v3.2.0
env:
CIBW_BUILD: ${{ matrix.python }}-macosx_arm64
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python }}-macosx_arm64
path: ./wheelhouse/*.whl
build_win:
name: Build wheel for ${{ matrix.python }}-win_amd64
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
python: [cp310, cp312, cp313t, cp314t]
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
cache-suffix: ${{ matrix.python }}-win_amd64
cache-dependency-glob: uv.lock
- name: Install Xmake
uses: MinoruSekine/setup-scoop@v4.0.2
with:
apps: xmake
- name: Cache Xmake
uses: actions/cache@v4
with:
path: ~/AppData/Local/.xmake
key: xmake-win_amd64-${{ hashFiles('xmake.lua') }}
- name: Build wheel
uses: pypa/cibuildwheel@v3.2.0
env:
CIBW_BUILD: ${{ matrix.python }}-win_amd64
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python }}-win_amd64
path: ./wheelhouse/*.whl
build_linux:
name: Build wheel for ${{ matrix.python }}-${{ matrix.platform }}_${{ matrix.archs }}
runs-on: ubuntu-24.04${{ matrix.archs == 'aarch64' && '-arm' || '' }}
strategy:
fail-fast: false
matrix:
python: [cp310, cp312, cp313t, cp314t]
platform: [manylinux, musllinux]
archs: [x86_64, aarch64]
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- name: Cache uv
uses: actions/cache@v4
with:
path: /tmp/setup-uv-cache
key: setup-uv-${{ hashFiles('uv.lock') }}-${{ matrix.python }}-${{ matrix.platform }}_${{ matrix.archs }}
- name: Cache tools
uses: actions/cache@v4
with:
path: /tmp/.local
key: tools-${{ matrix.platform }}_${{ matrix.archs }}
- name: Cache Xmake
uses: actions/cache@v4
with:
path: |
/tmp/.xmake
!/tmp/.xmake/**/.git
key: xmake-${{ matrix.platform }}_${{ matrix.archs }}-${{ hashFiles('xmake.lua') }}
- name: Build wheel
uses: pypa/cibuildwheel@v3.2.0
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform }}_${{ matrix.archs }}
- name: Chown Xmake cache
run: |
shopt -s globstar
sudo rm -rf /tmp/.xmake/**/.git # FIXME: workaround for https://github.com/actions/toolkit/issues/2155
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python }}-${{ matrix.platform }}_${{ matrix.archs }}
path: ./wheelhouse/*.whl
sdist:
name: Build Source Distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Build sdist
run: uv build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
package:
name: Package + Publish to PyPI
runs-on: ubuntu-latest
needs: [build_macosx, build_win, build_linux, sdist]
permissions:
id-token: write # required for OIDC trusted publisher
contents: read
steps:
- name: Download all wheels
uses: actions/download-artifact@v4
with:
path: dist
pattern: wheel-*
merge-multiple: true
- name: Download sdist
uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
run: uv publish --trusted-publishing always