-
Notifications
You must be signed in to change notification settings - Fork 4
163 lines (138 loc) · 5.59 KB
/
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
name: Wheel builder and tester
on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types:
- published
jobs:
build_wheels:
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }} ${{ matrix.buildplat[2] }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
matrix:
buildplat:
# Not supported for now
# - [ubuntu-22.04, musllinux, x86_64]
# - [windows-2019, win, AMD64]
# accelerate causes a segfault for some reason...
# - [macos-13, macosx, x86_64, accelerate, "14.0"]
# - [macos-14, macosx, arm64, accelerate, "14.0"]
# working
- [ubuntu-22.04, manylinux, x86_64]
- [macos-12, macosx, x86_64, openblas, "10.13"]
- [macos-14, macosx, arm64, openblas, "12.3"]
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]
# python: [["cp310", "3.10"]]
env:
IS_32_BIT: ${{ matrix.buildplat[2] == 'x86' }}
steps:
- name: Checkout pyAVL
uses: actions/checkout@v4
# Used to host cibuildwheel
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: win_amd64 - install rtools
run: |
# mingw-w64
choco install rtools --no-progress
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
if: ${{ runner.os == 'Windows' && env.IS_32_BIT == 'false' }}
- name: Setup macOS
if: startsWith( matrix.buildplat[0], 'macos-' )
run: |
if [[ ${{ matrix.buildplat[3] }} == 'accelerate' ]]; then
echo CIBW_CONFIG_SETTINGS=\"setup-args=-Dblas=accelerate\" >> "$GITHUB_ENV"
# Always use preinstalled gfortran for Accelerate builds
ln -s $(which gfortran-13) gfortran
export PATH=$PWD:$PATH
echo "PATH=$PATH" >> "$GITHUB_ENV"
LIB_PATH=$(dirname $(gfortran --print-file-name libgfortran.dylib))
fi
# Add libraries installed by cibw_before_build_macos.sh to path
if [[ ${{ matrix.buildplat[2] }} == 'arm64' ]]; then
LIB_PATH=$LIB_PATH:/opt/arm64-builds/lib
else
LIB_PATH=$LIB_PATH:/usr/local/lib
fi
if [[ ${{ matrix.buildplat[4] }} == '10.13' ]]; then
# 20240621 macos-12 images span Xcode 13.1-->14.2
XCODE_VER='13.4.1'
else
XCODE_VER='15.2'
fi
CIBW="sudo xcode-select -s /Applications/Xcode_${XCODE_VER}.app"
echo "CIBW_BEFORE_ALL=$CIBW" >> $GITHUB_ENV
# setting SDKROOT necessary when using the gfortran compiler
# installed in cibw_before_build_macos.sh
sudo xcode-select -s /Applications/Xcode_${XCODE_VER}.app
CIBW="MACOSX_DEPLOYMENT_TARGET=${{ matrix.buildplat[4] }}\
LD_LIBRARY_PATH=$LIB_PATH:$LD_LIBRARY_PATH\
PKG_CONFIG_PATH=$LIB_PATH/pkgconfig\
SDKROOT=$(xcrun --sdk macosx --show-sdk-path)"
echo "CIBW_ENVIRONMENT_MACOS=$CIBW" >> "$GITHUB_ENV"
echo "REPAIR_PATH=$LIB_PATH" >> "$GITHUB_ENV"
GFORTRAN_LIB="\$(dirname \$(gfortran --print-file-name libgfortran.dylib))"
CIBW="DYLD_LIBRARY_PATH=$GFORTRAN_LIB:$LIB_PATH delocate-listdeps {wheel} &&\
DYLD_LIBRARY_PATH=$GFORTRAN_LIB:$LIB_PATH delocate-wheel --require-archs \
{delocate_archs} -w {dest_dir} {wheel}"
# Rename x86 Accelerate wheel to test on macOS 13 runner
if [[ ${{ matrix.buildplat[0] }} == 'macos-13' && ${{ matrix.buildplat[4] }} == '14.0' ]]; then
CIBW+=" && mv {dest_dir}/\$(basename {wheel}) \
{dest_dir}/\$(echo \$(basename {wheel}) | sed 's/14_0/13_0/')"
fi
echo "CIBW_REPAIR_WHEEL_COMMAND_MACOS=$CIBW" >> "$GITHUB_ENV"
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}*
CIBW_ARCHS: ${{ matrix.buildplat[2] }}
CIBW_ENVIRONMENT_PASS_LINUX: RUNNER_OS
- uses: actions/upload-artifact@v4
name: upload the wheels
with:
path: ./wheelhouse/*.whl
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
${{ matrix.buildplat[2] }} ${{ matrix.buildplat[3] }}
${{ matrix.buildplat[4] }}
upload_all:
name: upload the wheels to PYPI
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- name: what is going on
run: pwd & ls -R
- name: Checkout pyAVL
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
id: download
name: download the wheels
with:
path: wheelhouse
- name: 'Echo download path'
run: echo ${{steps.download.outputs.download-path}}
- name: Display structure of downloaded files
run: ls -R
- name: make dist dir
run: mkdir dist
- name: Move wheels to dist
run: bash tools/wheels/move_wheels.sh
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
# packages-dir: wheelhouse/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
skip-existing: true
repository-url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
# packages-dir: wheelhouse/
skip-existing: true
password: ${{ secrets.PYPI_API_TOKEN }}