Debian Codegraph @

.github/workflows/wheels.yml

raw symbols SCIP
1 # Build Python wheels for PyPI distribution
2 # Triggered on YYYYMMDD version tags (e.g., 20260220)
3 # Wheels are built with CalVer version (e.g., 2026.2.20)
4
5 name: Build Wheels
6
7 on:
8 # Build on YYYYMMDD version tags
9 push:
10 tags:
11 - '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
12 # Allow manual trigger for testing
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 # Linux x86_64
30 - os: linux
31 arch: x86_64
32 runner: ubuntu-latest
33 # Linux aarch64 (uses QEMU emulation)
34 - os: linux
35 arch: aarch64
36 runner: ubuntu-latest
37 # macOS x86_64
38 - os: macos
39 arch: x86_64
40 runner: macos-13
41 # macOS arm64 (native runner)
42 - os: macos
43 arch: arm64
44 runner: macos-14
45 # Windows x86_64
46 - os: windows
47 arch: AMD64
48 runner: windows-latest
49
50 steps:
51 - uses: actions/checkout@v6
52
53 # Set up QEMU for Linux aarch64 emulation
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 # Only build for the current architecture
64 CIBW_ARCHS: ${{ matrix.arch }}
65 # Debug output if requested
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 # Test that the sdist can be installed from source
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 # Combine all artifacts into a single download
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 # PyPI upload - DISABLED for now
136 # Uncomment and configure trusted publishing when ready
137 # See: https://docs.pypi.org/trusted-publishers/
138 #
139 # publish:
140 # name: Publish to PyPI
141 # needs: [build_wheels, build_sdist]
142 # runs-on: ubuntu-latest
143 # # Only publish on tag pushes
144 # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
145 # environment:
146 # name: pypi
147 # url: https://pypi.org/p/fontforge
148 # permissions:
149 # id-token: write # Required for trusted publishing
150 # steps:
151 # - name: Download all artifacts
152 # uses: actions/download-artifact@v4
153 # with:
154 # path: dist
155 # merge-multiple: true
156 #
157 # - name: Publish to PyPI
158 # uses: pypa/gh-action-pypi-publish@release/v1