forked from rougier/freetype-py
-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (110 loc) · 3.46 KB
/
ci.yml
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
# based on https://github.com/joerick/cibuildwheel/blob/master/examples/github-minimal.yml
name: Build
on:
push:
branches: [master]
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches: [master]
jobs:
build:
name: Build wheels on ${{ matrix.os }} ${{ matrix.name }}
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
cibw_build: "cp37-*"
cibw_archs_linux: "auto64"
- os: windows-latest
cibw_build: "cp37-*"
- os: macos-latest
cibw_build: "cp38-macosx_universal2"
cibw_archs_macos: "universal2"
name: '(universal2)'
- os: 'ubuntu-latest'
cibw_build: "cp37-manylinux*"
cibw_archs_linux: 'aarch64'
name: '(manylinux aarch64)'
qemu: true
- os: 'ubuntu-latest'
cibw_build: "cp37-musllinux*"
cibw_archs_linux: 'aarch64'
name: '(musllinux aarch64)'
qemu: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # unshallow fetch for setuptools-scm
- name: Set up QEMU
if: matrix.qemu
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_ARCHS: "auto64"
CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }}
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
CIBW_ENVIRONMENT: "FREETYPEPY_BUNDLE_FT=yes PYTHON_ARCH=64"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_TEST_COMMAND: "pytest {project}/tests"
CIBW_TEST_REQUIRES: "pytest"
with:
output-dir: dist
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
path: dist
name: dist-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.build }}-${{ matrix.name }}
publish:
name: Publish release to Pypi
runs-on: ubuntu-latest
needs: [build]
if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/freetype-py/
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # unshallow fetch for setuptools-scm
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Download assets
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
pattern: dist-*
- name: Build sdist
run: |
python setup.py sdist
- uses: pypa/gh-action-pypi-publish@release/v1
test-pyinstaller:
name: Test pyinstaller hook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Test pyinstaller hook
env:
FREETYPEPY_BUNDLE_FT: yes
PYTHON_ARCH: 64
run: |
pip install pytest psutil pyinstaller>=4
pip install .
pytest -v --pyargs freetype.__pyinstaller.tests