forked from Pyomo/pyomo
-
Notifications
You must be signed in to change notification settings - Fork 2
208 lines (196 loc) · 7 KB
/
release_wheel_creation.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
name: Pyomo Release Distribution Creation
on:
push:
tags:
- '*'
schedule:
- cron: '0 0 3 * *'
workflow_dispatch:
inputs:
git-ref:
description: Git Hash (Optional)
required: false
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
native_wheels:
name: Build wheels (${{ matrix.wheel-version }}) on ${{ matrix.os }} for native and cross-compiled architecture
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest]
arch: [all]
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*', 'cp313*']
include:
- wheel-version: 'cp38*'
TARGET: 'py38'
GLOBAL_OPTIONS: "--with-cython --with-distributable-extensions"
- wheel-version: 'cp39*'
TARGET: 'py39'
GLOBAL_OPTIONS: "--with-cython --with-distributable-extensions"
- wheel-version: 'cp310*'
TARGET: 'py310'
GLOBAL_OPTIONS: "--with-cython --with-distributable-extensions"
- wheel-version: 'cp311*'
TARGET: 'py311'
GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions"
- wheel-version: 'cp312*'
TARGET: 'py312'
GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions"
- wheel-version: 'cp313*'
TARGET: 'py313'
GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions"
# We use pure python for any Windows/python greater than 3.10
exclude:
- wheel-version: 'cp311*'
os: windows-latest
- wheel-version: 'cp312*'
os: windows-latest
- wheel-version: 'cp313*'
os: windows-latest
steps:
- uses: actions/checkout@v4
- name: Create pyproject.toml
run: |
# Per the cibuildwheel documentation, you can technically use
# CIBW_BEFORE_BUILD to do these steps; however, as of the newest
# version (2.21.3) this feature does not work. This is a hack
# to make cibuildwheel recognize our pre-build requirements
echo -e '[build-system]\n\nrequires = [ "setuptools", "wheel", "cython", "pybind11" ]' > $GITHUB_WORKSPACE/pyproject.toml
cat $GITHUB_WORKSPACE/pyproject.toml
ls -la $GITHUB_WORKSPACE
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
with:
output-dir: dist
env:
CIBW_ARCHS_LINUX: "native"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ARCHS_WINDOWS: "AMD64 ARM64"
CIBW_BUILD: ${{ matrix.wheel-version }}
CIBW_SKIP: "*-musllinux*"
CIBW_BUILD_VERBOSITY: 1
CIBW_ENVIRONMENT: PYOMO_SETUP_ARGS="${{ matrix.GLOBAL_OPTIONS }}"
- uses: actions/upload-artifact@v4
with:
name: native_wheels-${{ matrix.os }}-${{ matrix.TARGET }}
path: dist/*.whl
overwrite: true
alternative_wheels:
name: Build wheels (${{ matrix.wheel-version }}) on ${{ matrix.os }} for aarch64
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
arch: [all]
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*', 'cp313*']
include:
- wheel-version: 'cp38*'
TARGET: 'py38'
GLOBAL_OPTIONS: "--with-cython --with-distributable-extensions"
- wheel-version: 'cp39*'
TARGET: 'py39'
GLOBAL_OPTIONS: "--with-cython --with-distributable-extensions"
- wheel-version: 'cp310*'
TARGET: 'py310'
GLOBAL_OPTIONS: "--with-cython --with-distributable-extensions"
- wheel-version: 'cp311*'
TARGET: 'py311'
GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions"
- wheel-version: 'cp312*'
TARGET: 'py312'
GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions"
- wheel-version: 'cp313*'
TARGET: 'py313'
GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions"
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Create pyproject.toml
run: |
# Per the cibuildwheel documentation, you can technically use
# CIBW_BEFORE_BUILD to do these steps; however, as of the newest
# version (2.21.3) this feature does not work. This is a hack
# to make cibuildwheel recognize our pre-build requirements
echo -e '[build-system]\n\nrequires = [ "setuptools", "wheel", "cython", "pybind11" ]' > $GITHUB_WORKSPACE/pyproject.toml
cat $GITHUB_WORKSPACE/pyproject.toml
ls -la $GITHUB_WORKSPACE
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
with:
output-dir: dist
env:
CIBW_ARCHS_LINUX: "aarch64"
CIBW_BUILD: ${{ matrix.wheel-version }}
CIBW_SKIP: "*-musllinux*"
CIBW_BUILD_VERBOSITY: 1
CIBW_ENVIRONMENT: PYOMO_SETUP_ARGS="${{ matrix.GLOBAL_OPTIONS }}"
- uses: actions/upload-artifact@v4
with:
name: alt_wheels-${{ matrix.os }}-${{ matrix.TARGET }}
path: dist/*.whl
overwrite: true
pure_python:
name: pure_python_wheel
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine wheel setuptools pybind11
- name: Build pure python wheel
run: |
python setup.py --without-cython sdist --format=gztar bdist_wheel
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: purepythonwheel
path: dist/*.whl
overwrite: true
generictarball:
name: ${{ matrix.TARGET }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
TARGET: generic_tarball
python-version: [3.8]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine wheel setuptools pybind11
- name: Build generic tarball
run: |
python setup.py --without-cython sdist --format=gztar
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: generictarball
path: dist
overwrite: true