forked from pymupdf/PyMuPDF
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (127 loc) · 4.75 KB
/
build_wheels.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
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
name: Build wheels
on:
workflow_dispatch:
inputs:
flavours:
description: 'If set, we build separate PyMuPDF and PyMuPDFb wheels.'
type: boolean
default: true
sdist:
type: boolean
default: true
wheels_linux_aarch64:
type: boolean
default: true
wheels_linux_auto:
type: boolean
default: true
wheels_linux_pyodide:
type: boolean
default: false
wheels_windows_auto:
type: boolean
default: true
wheels_macos_auto:
type: boolean
default: true
wheels_cps:
description: 'wheels_cps: sets $CIBW_BUILD, E.g. "cp310* cp311*".'
type: string
PYMUPDF_SETUP_MUPDF_BUILD:
description: 'Value for PYMUPDF_SETUP_MUPDF_BUILD, e.g.: git:--branch master https://github.com/ArtifexSoftware/mupdf.git'
type: string
default: '-'
#PYMUPDF_SETUP_MUPDF_BUILD_TYPE:
# description: 'Value for PYMUPDF_SETUP_MUPDF_BUILD, e.g. debug.'
# type: string
# default: '-'
# We can't currently have more than 10 inputs
PYMUPDF_SETUP_PY_LIMITED_API:
description: 'If not "0", we build a single wheel for each platform.'
type: string
default: ''
jobs:
build_sdist:
if: ${{ inputs.sdist }}
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
env:
inputs_wheels_default: 0
inputs_sdist: 1
inputs_flavours: ${{inputs.flavours}}
inputs_PYMUPDF_SETUP_MUPDF_BUILD: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD}}
run:
python scripts/gh_release.py
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels:
#if: ${{ inputs.wheels }}
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# 2024-05-08: Need to specify macos-13/14 to get x86_64/arm64.
os: [ubuntu-latest, windows-2019, macos-13, macos-14]
# Avoid cancelling of all cibuildwheel runs after a single failure.
fail-fast: false
steps:
- uses: actions/checkout@v4
# Get Python 3.12 x32 and x64 on Windows. (As of 2023-10-12 these are not
# always available by default.)
#
- name: Install Python 3.12 x32 on Windows.
if: runner.os == 'Windows'
uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: x86
- name: Install Python 3.12 x64 on Windows.
if: runner.os == 'Windows'
uses: actions/setup-python@v5
with:
python-version: '3.12'
# Get Python for running cibuildwheel. This also ensures that 'python'
# works on MacOS, where it seems only 'python3' is available by default.
#
# Note that it seem to be important on MacOS not to specify a
# Python version here with `python-version: '3.12'` - this makes
# `python-config3` return settings for Python-3.12, instead of for
# whatever Python is being used by cibuildwheel.
#
- uses: actions/setup-python@v5
# On Linux, get qemu so we can build for aarch64.
#
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: gh_release
# Doesn't seem to be a way to passing inputs.* on command
# line, so we set environment instead. E.g. see:
# https://github.com/orgs/community/discussions/27088
#
env:
inputs_flavours: ${{inputs.flavours}}
inputs_sdist: ${{inputs.sdist}}
inputs_wheels_linux_aarch64: ${{inputs.wheels_linux_aarch64}}
inputs_wheels_linux_auto: ${{inputs.wheels_linux_auto}}
inputs_wheels_linux_pyodide: ${{inputs.wheels_linux_pyodide}}
#inputs_wheels_macos_arm64: ${{inputs.wheels_macos_arm64}}
inputs_wheels_macos_auto: ${{inputs.wheels_macos_auto}}
inputs_wheels_windows_auto: ${{inputs.wheels_windows_auto}}
inputs_PYMUPDF_SETUP_MUPDF_BUILD: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD}}
#inputs_PYMUPDF_SETUP_MUPDF_BUILD_TYPE: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD_TYPE}}
inputs_wheels_cps: ${{inputs.wheels_cps}}
PYMUPDF_SETUP_PY_LIMITED_API: ${{inputs.PYMUPDF_SETUP_PY_LIMITED_API}}
run:
python scripts/gh_release.py
# Upload generated wheels, to be accessible from github Actions page.
#
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl