1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 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 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
|
name: Build Wheels
on:
push:
branches:
- main
- fix-wheel-build
- v*
release:
types: [created]
jobs:
build_wheels:
name: Build Wheels on ${{ matrix.os }}-${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Run 32 and 64 bit version in parallel for Windows
- os: windows-2022
platform_id: win_amd64
architecture: x64
- os: windows-2022
platform_id: win32
architecture: x86
- os: macos-13
platform_id: macosx_x86_64
architecture: x64
- os: macos-14
platform_id: macosx_arm64
architecture: arm64
env:
CIBW_BUILD: cp39-${{ matrix.platform_id }} cp310-${{ matrix.platform_id }} cp311-${{ matrix.platform_id }} cp312-${{ matrix.platform_id }} cp313-${{ matrix.platform_id }} cp314-${{ matrix.platform_id }}
CIBW_SKIP: pp* cp38*
CIBW_BEFORE_BUILD_MACOS: "python packing/download_pango_macos.py ${{ matrix.architecture }}"
CIBW_BEFORE_BUILD_WINDOWS: "python packing/download_dlls.py"
CIBW_ENVIRONMENT_WINDOWS: "PKG_CONFIG_PATH='C:\\cibw\\vendor\\lib\\pkgconfig'"
CIBW_ENVIRONMENT_MACOS: "PKG_CONFIG_PATH='/Users/runner/pangobuild/lib/pkgconfig' MACOSX_DEPLOYMENT_TARGET='10.13'"
CIBW_TEST_REQUIRES: pytest pytest-cov
CIBW_TEST_COMMAND: "bash {project}/packing/test_wheels.sh {project}"
steps:
- uses: actions/checkout@v4
- name: Set Path for pkg-config
if: runner.os == 'windows'
run: |
$env:Path = "C:\cibw\pkg-config\bin;C:\cibw\vendor\bin;$($env:PATH)"
echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build wheels (Windows)
if: runner.os == 'windows'
shell: pwsh
run: |
Copy-Item packing/LICENSE.bin .
Rename-Item LICENSE.bin LICENSE.win32
- name: Build wheels (Non-Windows)
if: runner.os != 'windows'
run: |
cp packing/LICENSE.bin .
- name: Build wheels
uses: pypa/cibuildwheel@v3.2.1
env:
PKG_CONFIG_PATH: "C:\\cibw\\vendor\\lib\\pkgconfig"
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: wheels-${{ runner.os }}-${{ matrix.platform_id }}
test_wheels_win:
name: Test wheels on Windows - ${{ matrix.platform_id }} (${{ matrix.python-version }})
needs: [build_wheels]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
architecture: [x64, x86]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
include: [
{platform_id: win_amd64, architecture: x64},
{platform_id: win32, architecture: x86},
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
allow-prereleases: true
- uses: actions/download-artifact@v4
with:
name: wheels-${{ runner.os }}-${{ matrix.platform_id }}
path: ~/wheelhouse
- name: Install test dependencies
run: |
pip install pytest pytest-cov
- name: Install wheels
run: |
pip install --no-index --find-links ~/wheelhouse ManimPango
- name: Run tests
shell: bash
run: |
bash packing/test_wheels.sh $(pwd)
test_wheels_mac:
name: Test wheels on macOS - ${{ matrix.platform_id }} (${{ matrix.python-version }})
needs: [build_wheels]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
architecture: [x64, arm64]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
include: [
{platform_id: macosx_x86_64, architecture: x64, os: macos-13},
{platform_id: macosx_arm64, architecture: arm64, os: macos-14},
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture == 'arm64' && null || matrix.architecture }}
allow-prereleases: true
- uses: actions/download-artifact@v4
with:
name: wheels-${{ runner.os }}-${{ matrix.platform_id }}
path: ~/wheelhouse
- name: Install test dependencies
run: |
pip install pytest pytest-cov
- name: Install wheels
run: |
pip install --no-index --find-links ~/wheelhouse ManimPango
- name: Run tests
shell: bash
run: |
bash packing/test_wheels.sh $(pwd)
build_sdist:
name: Source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
sudo apt install libcairo2-dev pkg-config python3-dev
sudo apt-get install libpango1.0-dev
python -m pip install --upgrade build
- name: Build sdist
run: python -m build --sdist
- name: Test sdist
run: |
python -m pip install dist/*.tar.gz
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: manimpango-src
publish:
needs: [test_wheels_mac, test_wheels_win, build_sdist]
name: Upload wheels to PyPI
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/ManimPango
permissions:
id-token: write
contents: write
if: github.event_name== 'release'
steps:
- uses: actions/download-artifact@v4
with:
path: downloads/
- name: Move files to dist
run: |
mkdir -p dist/
find downloads/ -name \*.whl -exec cp {} dist \;
find downloads/ -name \*.tar.gz -exec cp {} dist \;
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Release
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: false
files: |
dist/*.whl
dist/*.tar.gz
success:
needs: [test_wheels_win, test_wheels_mac]
runs-on: ubuntu-latest
name: Building and testing of wheels success
steps:
- name: Success
run: echo "Building and testing of wheels success"
|