-
Notifications
You must be signed in to change notification settings - Fork 34
196 lines (190 loc) · 7.16 KB
/
action.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
name: CLIPSPy build job
on: [push, pull_request]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Manylinux Container
run: |
docker build -t clipspy-build-wheels:latest -f manylinux/Dockerfile .
- name: Build Manylinux packages
run: |
docker run --rm -v `pwd`/manylinux/wheelhouse:/io/wheelhouse clipspy-build-wheels:latest
- name: Store build artifacts
uses: actions/upload-artifact@v3
with:
name: linux-build
path: manylinux/wheelhouse
build-windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v2
# Install nmake
- uses: ilammy/msvc-dev-cmd@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Build CLIPSPy
run: |
python -m pip install --upgrade pip
pip install --upgrade cffi wheel pytest setuptools
nmake /F Makefile.win
- name: Install CLIPSPy
run: |
pip install clipspy --no-index --find-links dist
- name: Run tests
run: |
# Run test from outside module to test installed package
cd ../
python -m pytest -v clipspy/test
- name: Store build artifacts
uses: actions/upload-artifact@v3
with:
name: windows-build
path: dist/
build-macos-intel:
# On MACOS 13, user 'runner' is not part of wheel group.
# Hence, we need to use sudo everywhere.
# Moreover, installed Python is 'universal2', this leads to packages
# being mistakenly built as 'universal2' instead of 'x86_64'.
# This confuses the heck out of 'delocate-wheel' which we need to patch
# to make it work.
runs-on: macos-13
env:
ARCHFLAGS: "-arch x86_64"
MACOSX_DEPLOYMENT_TARGET: "11.0"
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade cffi wheel delocate pytest setuptools
- name: Build and install CLIPS
run: |
make clips
sudo make install-clips
- name: Build CLIPSPy
run: |
export PY_PLATFORM=$(python -c "import sysconfig; print('%s' % sysconfig.get_platform());")
export _PYTHON_HOST_PLATFORM="${PY_PLATFORM/universal2/x86_64}"
sudo --preserve-env make clipspy
- name: Repair wheels
run: |
# This is a shortcut to have a successful delocate-wheel. Credits: @alexsavulescu
# See: https://github.com/matthew-brett/delocate/issues/153
python -c "import os,delocate; print(os.path.join(os.path.dirname(delocate.__file__), 'tools.py'));quit()" | xargs -I{} sed -i."" "s/first, /input.pop('x86_64',None); first, /g" {}
sudo delocate-wheel -v dist/*.whl
- name: Install CLIPSPy
run: |
pip install dist/*.whl
- name: Run tests
run: |
# Run test from outside module to test installed package
cd ../
python -m pytest -v clipspy/test
- name: Store build artifacts
uses: actions/upload-artifact@v3
with:
name: macos-intel-build
path: dist/
build-macos-arm:
# On MACOS 14, user 'runner' is not part of wheel group.
# Hence, we need to use sudo everywhere.
# Moreover, installed Python is 'universal2', this leads to packages
# being mistakenly built as 'universal2' instead of 'arm64'.
# This confuses the heck out of 'delocate-wheel' which we need to patch
# to make it work.
runs-on: macos-14
env:
ARCHFLAGS: "-arch arm64"
MACOSX_DEPLOYMENT_TARGET: "11.0"
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade cffi wheel delocate pytest setuptools
- name: Build and install CLIPS
run: |
make clips
sudo make install-clips
- name: Build CLIPSPy
run: |
export PY_PLATFORM=$(python -c "import sysconfig; print('%s' % sysconfig.get_platform());")
export _PYTHON_HOST_PLATFORM="${PY_PLATFORM/universal2/arm64}"
sudo --preserve-env make clipspy
- name: Repair wheels
run: |
# This is a shortcut to have a successful delocate-wheel. Credits: @alexsavulescu
# See: https://github.com/matthew-brett/delocate/issues/153
python -c "import os,delocate; print(os.path.join(os.path.dirname(delocate.__file__), 'tools.py'));quit()" | xargs -I{} sed -i."" "s/first, /input.pop('x86_64',None); first, /g" {}
sudo delocate-wheel -v dist/*.whl
- name: Install CLIPSPy
run: |
pip install dist/*.whl
- name: Run tests
run: |
# Run test from outside module to test installed package
cd ../
python -m pytest -v clipspy/test
- name: Store build artifacts
uses: actions/upload-artifact@v3
with:
name: macos-arm-build
path: dist/
build-macos-universal:
# Merge MACOS 'x86_64' and 'arm64' into 'universal2' for most recent versions of Python.
needs: [build-macos-intel, build-macos-arm]
runs-on: macos-13
steps:
- uses: actions/download-artifact@v3
with:
name: macos-intel-build
path: artifacts/
- uses: actions/download-artifact@v3
with:
name: macos-arm-build
path: artifacts/
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Install rename utility
run: |
brew update
brew install rename
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade wheel delocate setuptools
- name: Run delocate fuse onto the wheels
run: |
mkdir -p dist
# Can't understand why globbing does not work in here
delocate-fuse artifacts/clipspy-1.0.4-cp311-cp311-macosx_11_0_arm64.whl artifacts/clipspy-1.0.4-cp311-cp311-macosx_11_0_x86_64.whl -w dist/
delocate-fuse artifacts/clipspy-1.0.4-cp312-cp312-macosx_11_0_arm64.whl artifacts/clipspy-1.0.4-cp312-cp312-macosx_11_0_x86_64.whl -w dist/
rename "s/arm64/universal2/" dist/*.whl
- name: Store build artifacts
uses: actions/upload-artifact@v3
with:
name: macos-universal-build
path: dist/