-
Notifications
You must be signed in to change notification settings - Fork 0
191 lines (170 loc) · 8.06 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
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
name: Build Wheels
on: push
jobs:
load_config:
runs-on: ubuntu-latest
outputs:
date: ${{ steps.load.outputs.date }}
linuxaarch64: ${{ steps.load.outputs.linuxaarch64 }}
linuxx86_64: ${{ steps.load.outputs.linuxx86_64 }}
macaarch64: ${{ steps.load.outputs.macaarch64 }}
macx86_64: ${{ steps.load.outputs.macx86_64 }}
macpath: ${{ steps.load.outputs.macpath }}
user: ${{ steps.load.outputs.user }}
windows: ${{ steps.load.outputs.windows }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Load the configuration
id: load
run: |
echo user=`jq -r .user config.json` >> $GITHUB_OUTPUT
echo macaarch64=`jq -r .macaarch64 config.json` >> $GITHUB_OUTPUT
echo macx86_64=`jq -r .macx86_64 config.json` >> $GITHUB_OUTPUT
echo windows=`jq -r .windows config.json` >> $GITHUB_OUTPUT
echo linuxaarch64=`jq -r .linuxaarch64 config.json` >> $GITHUB_OUTPUT
echo linuxx86_64=`jq -r .linuxx86_64 config.json` >> $GITHUB_OUTPUT
echo date=`jq -r .date config.json` >> $GITHUB_OUTPUT
echo macpath=`jq -r .macpath config.json` >> $GITHUB_OUTPUT
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: load_config
env:
W_USER: ${{ needs.load_config.outputs.user }}
W_MACAARCH64: ${{ needs.load_config.outputs.macaarch64 }}
W_MACX86_64: ${{ needs.load_config.outputs.macx86_64 }}
W_WINDOWS: ${{ needs.load_config.outputs.windows }}
W_LINUXAARCH64: ${{ needs.load_config.outputs.linuxaarch64 }}
W_LINUXX86_64: ${{ needs.load_config.outputs.linuxx86_64 }}
W_DATE: ${{ needs.load_config.outputs.date }}
MACPATH: ${{ needs.load_config.outputs.macpath }}
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel==1.2.0"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path libs/win -w {dest_dir} {wheel}"
permissions:
id-token: write
contents: read
strategy:
matrix:
os: [macos-latest, ubuntu-20.04, windows-2019]
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials for reading the bucket
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::299107274666:role/staging-wheels-GithubActionReadRoleDF6D587B-yrJ3M0M0VbMY
aws-region: eu-west-2
- name: Summarize the config
run: |
echo "Date:" ${{ env.W_DATE }}
echo "User:" ${{ env.W_USER }}
echo "Mac (aarch64):" ${{ env.W_MACAARCH64 }}
echo "Mac (x86):" ${{ env.W_MACX86_64 }}
echo "Linux (aarch64):" ${{ env.W_LINUXAARCH64 }}
echo "Linux (x86):" ${{ env.W_LINUXX86_64 }}
echo "Windows:" ${{ env.W_WINDOWS }}
uname -p
- uses: actions/setup-python@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2
- name: Get the Mac aarch64 binaries
if: matrix.os == 'macos-latest' && env.W_MACAARCH64 == 'true'
run: |
aws s3 cp s3://saxonica-wheel-staging/${{ env.W_USER }}/mac-aarch64.wheels.tar.gz libs.tar.gz
sudo rm -rf mac
tar zxvf libs.tar.gz
rm -f libs.tar.gz
- name: Copy the Mac arch64 binaries to a fixed location
if: matrix.os == 'macos-latest' && env.W_MACAARCH64 == 'true'
run: |
sudo mkdir -p ${{ env.MACPATH }}/build/eec/libsaxon
sudo mkdir -p ${{ env.MACPATH }}/build/pec/libsaxon
sudo mkdir -p ${{ env.MACPATH }}/build/hec/libsaxon
sudo cp mac/*/libs/darwin/* ${{ env.MACPATH }}/build/eec/libsaxon/
sudo cp mac/*/libs/darwin/* ${{ env.MACPATH }}/build/pec/libsaxon/
sudo cp mac/*/libs/darwin/* ${{ env.MACPATH }}/build/hec/libsaxon/
- name: Build the Mac arch64 wheels
if: matrix.os == 'macos-latest' && env.W_MACAARCH64 == 'true'
env:
CIBW_ARCHS_MACOS: arm64
run: |
ls -laR /Volumes/Saxonica/src/saxonica/saxondev
cd mac/eec_pypi && python -m cibuildwheel --output-dir ../../macwheelhouse --platform macos && cd ../..
cd mac/pec_pypi && python -m cibuildwheel --output-dir ../../macwheelhouse --platform macos && cd ../..
cd mac/hec_pypi && python -m cibuildwheel --output-dir ../../macwheelhouse --platform macos && cd ../..
- name: Get the Mac x86 binaries
if: matrix.os == 'macos-latest' && env.W_MACX86_64 == 'true'
run: |
aws s3 cp s3://saxonica-wheel-staging/${{ env.W_USER }}/mac-x86_64.wheels.tar.gz libs.tar.gz
sudo rm -rf mac
tar zxvf libs.tar.gz
rm -f libs.tar.gz
- name: Copy the Mac x86 binaries to a fixed location
if: matrix.os == 'macos-latest' && env.W_MACX86_64 == 'true'
run: |
sudo mkdir -p ${{ env.MACPATH }}/build/eec/libsaxon
sudo mkdir -p ${{ env.MACPATH }}/build/pec/libsaxon
sudo mkdir -p ${{ env.MACPATH }}/build/hec/libsaxon
sudo cp mac/*/libs/darwin/* ${{ env.MACPATH }}/build/eec/libsaxon/
sudo cp mac/*/libs/darwin/* ${{ env.MACPATH }}/build/pec/libsaxon/
sudo cp mac/*/libs/darwin/* ${{ env.MACPATH }}/build/hec/libsaxon/
- name: Build the Mac x86 wheels
if: matrix.os == 'macos-latest' && env.W_MACX86_64 == 'true'
env:
CIBW_ARCHS_MACOS: x86_64
run: |
cd mac/eec_pypi && python -m cibuildwheel --output-dir ../../macwheelhouse --platform macos && cd ../..
cd mac/pec_pypi && python -m cibuildwheel --output-dir ../../macwheelhouse --platform macos && cd ../..
cd mac/hec_pypi && python -m cibuildwheel --output-dir ../../macwheelhouse --platform macos && cd ../..
- name: Get the Linux x86 binaries
if: matrix.os == 'ubuntu-20.04' && env.W_LINUXX86_64 == 'true'
run: |
aws s3 cp s3://saxonica-wheel-staging/${{ env.W_USER }}/linux-x86_64.wheels.tar.gz libs.tar.gz
tar zxvf libs.tar.gz
rm -f libs.tar.gz
- name: Build the Linux x86 wheels
if: matrix.os == 'ubuntu-20.04' && env.W_LINUXX86_64 == 'true'
env:
CIBW_ARCHS_LINUX: x86_64
run: |
cd linux/eec_pypi && python -m cibuildwheel --output-dir ../../linuxwheelhouse --platform linux && cd ../..
cd linux/pec_pypi && python -m cibuildwheel --output-dir ../../linuxwheelhouse --platform linux && cd ../..
cd linux/hec_pypi && python -m cibuildwheel --output-dir ../../linuxwheelhouse --platform linux && cd ../..
- name: Get the Windows x86 binaries
if: matrix.os == 'windows-2019' && env.W_WINDOWS == 'true'
run: |
aws s3 cp s3://saxonica-wheel-staging/${{ env.W_USER }}/windows-x86_64.wheels.tar.gz libs.tar.gz
tar zxvf libs.tar.gz
del libs.tar.gz
- name: Build the Windows x86 wheels
if: matrix.os == 'windows-2019' && env.W_WINDOWS == 'true'
run: |
cd windows/eec_pypi
copy libs/win/*.lib .
python -m cibuildwheel --output-dir ../../windowswheelhouse --platform windows
cd ../..
cd windows/pec_pypi
copy libs/win/*.lib .
python -m cibuildwheel --output-dir ../../windowswheelhouse --platform windows
cd ../..
cd windows/hec_pypi
copy libs/win/*.lib .
python -m cibuildwheel --output-dir ../../windowswheelhouse --platform windows
cd ../..
- uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-20.04' && env.W_LINUXX86_64 == 'true'
with:
name: linux-wheels
path: ./linuxwheelhouse/*.whl
- uses: actions/upload-artifact@v3
if: matrix.os == 'macos-latest' && (env.W_MACAARCH64 == 'true' || env.W_MACX86_64 == 'true')
with:
name: mac-wheels
path: ./macwheelhouse/*.whl
- uses: actions/upload-artifact@v3
if: matrix.os == 'windows-2019' && env.W_WINDOWS == 'true'
with:
name: windows-wheels
path: ./windowswheelhouse/*.whl