forked from miniupnp/miniupnp
-
Notifications
You must be signed in to change notification settings - Fork 1
230 lines (208 loc) · 6.84 KB
/
miniupnpc_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
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
225
226
227
228
229
230
# Copyright 2024 Chia Network Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# copied from https://github.com/Chia-Network/build-wheels/blob/52e183920e3ec44017ed767c65e9b204536c0f13/.github/workflows/miniupnpc.yml
name: "build miniupnpc wheels"
on:
push:
branches:
- master
tags:
- '**'
pull_request:
branches:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || format('{0}-{1}-{2}', github.ref, github.event_name, github.ref == 'refs/heads/main' && github.sha || '') }}
cancel-in-progress: true
defaults:
run:
shell: bash
permissions:
id-token: write
contents: read
jobs:
build:
name: ${{ matrix.os.emoji }} 📦 Build ${{ matrix.arch.name }} ${{ matrix.python.major-dot-minor }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
strategy:
fail-fast: false
matrix:
os:
- name: macOS
file-name: macos
matrix: macos
emoji: 🍎
runs-on:
arm: [macos-14]
intel: [macos-latest]
macosx-deployment-target:
arm: 11.0
intel: 10.14
cibw-archs:
# TODO: do we need universal2?
arm: arm64
intel: x86_64
- name: Linux
file-name: linux
matrix: linux
emoji: 🐧
runs-on:
arm: [ubuntu-latest]
intel: [ubuntu-latest]
cibw-archs:
arm: aarch64
intel: x86_64
- name: Windows
file-name: windows
matrix: windows
emoji: 🪟
runs-on:
intel: [windows-latest]
cibw-archs:
intel: x86_64
python:
- major-dot-minor: '3.7'
cibw-build: 'cp37-*'
manylinux:
arm: manylinux2014
intel: manylinux2010
matrix: '3.7'
- major-dot-minor: '3.8'
cibw-build: 'cp38-*'
manylinux:
arm: manylinux2014
intel: manylinux2010
matrix: '3.8'
- major-dot-minor: '3.9'
cibw-build: 'cp39-*'
manylinux:
arm: manylinux2014
intel: manylinux2010
matrix: '3.9'
- major-dot-minor: '3.10'
cibw-build: 'cp310-*'
manylinux:
arm: manylinux2014
intel: manylinux2010
matrix: '3.10'
- major-dot-minor: '3.11'
cibw-build: 'cp311-*'
manylinux:
arm: manylinux2014
intel: manylinux2014
matrix: '3.11'
- major-dot-minor: '3.12'
cibw-build: 'cp312-*'
manylinux:
arm: manylinux2014
intel: manylinux2014
matrix: '3.12'
arch:
- name: ARM
file-name: arm
matrix: arm
cibw: aarch64
- name: Intel
file-name: intel
matrix: intel
cibw: x86_64
exclude:
- os: # excluding windows entirely as that is presently handled in AppVeyor
matrix: windows
- os:
matrix: windows
arch:
matrix: arm
- os:
matrix: macos
arch:
matrix: arm
python:
matrix: '3.7'
- os:
matrix: macos
arch:
matrix: arm
python:
matrix: '3.8'
- os:
matrix: macos
arch:
matrix: arm
python:
matrix: '3.9'
env:
FILE_NAME: ${{ matrix.os.file-name }}-${{ matrix.arch.file-name }}-${{ matrix.python.major-dot-minor }}
CIBW_ARCHS: ${{ matrix.os.cibw-archs[matrix.arch.matrix] }}
CIBW_BUILD: ${{ matrix.python.cibw-build }}
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ matrix.os.macosx-deployment-target[matrix.arch.matrix] }}
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.python.manylinux['arm'] }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.python.manylinux['intel'] }}
CIBW_PRERELEASE_PYTHONS: True
CIBW_SKIP: '*-manylinux_i686 *-win32 *-musllinux_*'
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python.major-dot-minor }}
- uses: actions/checkout@v4
with:
path: cloned
- uses: ./cloned/.github/actions/create-venv
id: create-venv
- uses: ./cloned/.github/actions/activate-venv
with:
directories: ${{ steps.create-venv.outputs.activate-venv-directories }}
- name: Update pip
run: |
python -m pip install --upgrade pip
- name: Copy out miniupnpc
run: |
cp -RLv cloned/miniupnpc source
- name: Set up QEMU
if: matrix.os.matrix == 'linux' && matrix.arch.matrix == 'arm'
uses: docker/setup-qemu-action@v3
- name: Build and test
if: matrix.os.matrix != 'windows'
run: |
pip install 'cibuildwheel==2.13.1; python_version < "3.8"' 'cibuildwheel==2.16.5; python_version >= "3.8"'
cibuildwheel source --output-dir dist
- name: Build (Windows)
if: matrix.os.matrix == 'windows'
run: |
cd source
mingw32-make -f Makefile.mingw CC=gcc
python -m pip install setuptools wheel
mingw32-make -f Makefile.mingw pythonmodule PYTHON=python
7z a dist/*.whl miniupnpc.dll
mkdir ../dist
cp dist/*.whl ../dist
- uses: ./cloned/.github/actions/create-venv
id: create-test-venv
- uses: ./cloned/.github/actions/activate-venv
with:
directories: ${{ steps.create-test-venv.outputs.activate-venv-directories }}
- name: Install
if: matrix.arch.matrix != 'arm'
run: |
pip install --no-index --only-binary :all: --find-links dist miniupnpc
- name: Import
if: matrix.arch.matrix != 'arm'
run: |
python -c 'import miniupnpc; print(miniupnpc)'
- uses: actions/upload-artifact@v4
if: always()
with:
name: wheel-${{ env.FILE_NAME }}
path: ./dist
if-no-files-found: error