| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
name: Build Wheels |
| 6 |
|
| 7 |
on: |
| 8 |
|
| 9 |
push: |
| 10 |
tags: |
| 11 |
- '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' |
| 12 |
|
| 13 |
workflow_dispatch: |
| 14 |
inputs: |
| 15 |
debug: |
| 16 |
description: 'Enable debug output' |
| 17 |
required: false |
| 18 |
default: false |
| 19 |
type: boolean |
| 20 |
|
| 21 |
jobs: |
| 22 |
build_wheels: |
| 23 |
name: Build ${{ matrix.os }} ${{ matrix.arch }} wheels |
| 24 |
runs-on: ${{ matrix.runner }} |
| 25 |
strategy: |
| 26 |
fail-fast: false |
| 27 |
matrix: |
| 28 |
include: |
| 29 |
|
| 30 |
- os: linux |
| 31 |
arch: x86_64 |
| 32 |
runner: ubuntu-latest |
| 33 |
|
| 34 |
- os: linux |
| 35 |
arch: aarch64 |
| 36 |
runner: ubuntu-latest |
| 37 |
|
| 38 |
- os: macos |
| 39 |
arch: x86_64 |
| 40 |
runner: macos-13 |
| 41 |
|
| 42 |
- os: macos |
| 43 |
arch: arm64 |
| 44 |
runner: macos-14 |
| 45 |
|
| 46 |
- os: windows |
| 47 |
arch: AMD64 |
| 48 |
runner: windows-latest |
| 49 |
|
| 50 |
steps: |
| 51 |
- uses: actions/checkout@v6 |
| 52 |
|
| 53 |
|
| 54 |
- name: Set up QEMU |
| 55 |
if: matrix.os == 'linux' && matrix.arch == 'aarch64' |
| 56 |
uses: docker/setup-qemu-action@v3 |
| 57 |
with: |
| 58 |
platforms: arm64 |
| 59 |
|
| 60 |
- name: Build wheels |
| 61 |
uses: pypa/[email protected] |
| 62 |
env: |
| 63 |
|
| 64 |
CIBW_ARCHS: ${{ matrix.arch }} |
| 65 |
|
| 66 |
CIBW_BUILD_VERBOSITY: ${{ inputs.debug && '3' || '1' }} |
| 67 |
|
| 68 |
- name: Upload wheels |
| 69 |
uses: actions/upload-artifact@v7 |
| 70 |
with: |
| 71 |
name: wheels-${{ matrix.os }}-${{ matrix.arch }} |
| 72 |
path: ./wheelhouse/*.whl |
| 73 |
|
| 74 |
build_sdist: |
| 75 |
name: Build source distribution |
| 76 |
runs-on: ubuntu-latest |
| 77 |
steps: |
| 78 |
- uses: actions/checkout@v6 |
| 79 |
|
| 80 |
- name: Build sdist |
| 81 |
run: pipx run build --sdist |
| 82 |
|
| 83 |
- name: Upload sdist |
| 84 |
uses: actions/upload-artifact@v7 |
| 85 |
with: |
| 86 |
name: sdist |
| 87 |
path: dist/*.tar.gz |
| 88 |
|
| 89 |
|
| 90 |
test_sdist: |
| 91 |
name: Test source distribution |
| 92 |
needs: build_sdist |
| 93 |
runs-on: ubuntu-latest |
| 94 |
steps: |
| 95 |
- name: Install build dependencies |
| 96 |
run: | |
| 97 |
sudo apt-get update |
| 98 |
sudo apt-get install -y \ |
| 99 |
cmake ninja-build \ |
| 100 |
libfreetype-dev libxml2-dev zlib1g-dev \ |
| 101 |
libpng-dev libjpeg-dev libtiff-dev |
| 102 |
|
| 103 |
- name: Download sdist |
| 104 |
uses: actions/download-artifact@v4 |
| 105 |
with: |
| 106 |
name: sdist |
| 107 |
|
| 108 |
- name: Install from sdist |
| 109 |
run: pip install fontforge-*.tar.gz -v |
| 110 |
|
| 111 |
- name: Test import |
| 112 |
run: python -c "import fontforge; import psMat; print('fontforge version:', fontforge.version())" |
| 113 |
|
| 114 |
|
| 115 |
combine_artifacts: |
| 116 |
name: Combine artifacts |
| 117 |
needs: [build_wheels, build_sdist, test_sdist] |
| 118 |
runs-on: ubuntu-latest |
| 119 |
steps: |
| 120 |
- name: Download all artifacts |
| 121 |
uses: actions/download-artifact@v4 |
| 122 |
with: |
| 123 |
path: dist |
| 124 |
merge-multiple: true |
| 125 |
|
| 126 |
- name: List artifacts |
| 127 |
run: ls -la dist/ |
| 128 |
|
| 129 |
- name: Upload combined artifacts |
| 130 |
uses: actions/upload-artifact@v7 |
| 131 |
with: |
| 132 |
name: all-packages |
| 133 |
path: dist/ |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|