-
Notifications
You must be signed in to change notification settings - Fork 0
252 lines (218 loc) · 7.33 KB
/
release.yml
File metadata and controls
252 lines (218 loc) · 7.33 KB
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
name: "Release new version"
on:
workflow_run:
workflows:
- "Python Bindings Unit Tests"
branches:
- main
types:
- completed
jobs:
check-tag-existance:
name: "Check if tag exists"
runs-on: ubuntu-latest
outputs:
exists: ${{ steps.check-tag.outputs.exists }}
steps:
- uses: actions/checkout@v6
- name: "Get CAPIO-CL version"
run: echo "CAPIO_CL_VERSION=$(grep -E 'VERSION [0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt | awk '{print $2}')" >> $GITHUB_ENV
- name: "Check if tag exists"
id: check-tag
uses: mukunku/tag-exists-action@v1.7.0
with:
tag: "v${{ env.CAPIO_CL_VERSION }}"
generate-documentation:
name: "Build documentation"
needs:
- check-tag-existance
if: ${{ needs.check-tag-existance.outputs.exists == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: "Install packages"
run: |
sudo apt update
sudo apt install wget make graphviz texlive texlive-latex-extra
- name: "Install Doxygen 1.14.0"
run: |
wget https://www.doxygen.nl/files/doxygen-1.14.0.linux.bin.tar.gz
tar -xzf doxygen-1.14.0.linux.bin.tar.gz
sudo mv doxygen-1.14.0/bin/doxygen /usr/local/bin/doxygen
doxygen --version
- name: "Run Doxygen"
working-directory: doxygen
run: make pdf
- name: "Upload pdf documentation"
if: success()
uses: actions/upload-artifact@v7
with:
path: "doxygen/documentation*.pdf"
name: "documentation.pdf"
- name: "Deploy documentation page"
uses: appleboy/scp-action@v1.0.0
with:
host: capio.hpc4ai.it
key: ${{ secrets.CAPIO_CL_DOC_DEPLOY_KEY }}
rm: true
source: "doxygen/generated/html/"
strip_components: 3
target: /mnt/services/capio/nginx/html/capiocl
username: capio-user
riscv-wheels:
name: "Build RiscV Ubuntu python wheels"
if: ${{ needs.check-tag-existance.outputs.exists == 'false' }}
needs:
- check-tag-existance
runs-on: ubuntu-latest
strategy:
matrix:
python: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
env:
INSTALL_PREFIX: "/usr/local"
PYTHON_VERSION: "${{ matrix.python }}"
steps:
- name: "Checkout repository"
uses: actions/checkout@v6
- name: "Build and test inside RISC-V emulated environment (Debian based)"
uses: uraimo/run-on-arch-action@v3
with:
arch: riscv64
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3 python3-pip python3-venv python3-wheel python3-setuptools \
g++ cmake ninja-build git
run: |
set -eux
echo "Building for RISC-V on Ubuntu 22.04"
python3 -m pip install --upgrade pip
python3 -m pip install -r build-requirements.txt
mkdir -p /tmp/capio_cl_jsons
mkdir -p /tmp/capio_cl_tomls
cp -r tests/jsons/* /tmp/capio_cl_jsons
cp -r tests/tomls/* /tmp/capio_cl_tomls
python3 -m build \
-Ccmake.define.ENABLE_COVERAGE=OFF \
-Ccmake.build-type=Release \
-Ccmake.define.CAPIO_CL_BUILD_TESTS=OFF
mv dist/*.whl dist/py_capio_cl_ubunturv64_python_${{matrix.python}}.whl
- name: "Upload built RISC-V wheel"
if: success()
uses: actions/upload-artifact@v7
with:
name: "${{ format('py_capio_cl_ubunturv64_python_{0}.whl', matrix.python) }}"
path: "dist/${{ format('py_capio_cl_ubunturv64_python_{0}.whl', matrix.python) }}"
github:
name: "Create GitHub Release"
if: ${{ needs.check-tag-existance.outputs.exists == 'false' && github.event.workflow_run.conclusion == 'success' }}
needs: [ riscv-wheels, generate-documentation ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: "Download built wheel artifacts"
uses: actions/download-artifact@v8
with:
path: dist
- name: "Get CAPIO-CL version"
run: echo "CAPIO_CL_VERSION=$(grep -E 'VERSION [0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt | awk '{print $2}')" >> $GITHUB_ENV
- name: "Create GitHub Release"
uses: softprops/action-gh-release@v3
with:
name: "v${{ env.CAPIO_CL_VERSION }}"
tag_name: "v${{ env.CAPIO_CL_VERSION }}"
generate_release_notes: true
files: |
**/*.whl
**/*.pdf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: ${{ needs.check-tag-existance.outputs.exists == 'false'}}
needs: [ github ]
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'ubuntu-24.04-arm', 'macos-15-intel', 'macos-latest' ]
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install cibuildwheel
run: python -m pip install --upgrade cibuildwheel
- name: Build wheels
env:
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
MACOSX_DEPLOYMENT_TARGET: "15.0"
CIBW_BUILD_VERBOSITY: 1
run: |
cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
sdist:
name: Build sdist
runs-on: ubuntu-latest
if: ${{ needs.check-tag-existance.outputs.exists == 'false'}}
needs: [ github ]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- run: |
python -m pip install --upgrade build
python -m build --sdist
- uses: actions/upload-artifact@v7
with:
name: sdist
path: dist/*.tar.gz
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [ build, sdist, riscv-wheels ]
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
path: dist_all
name: wheels-ubuntu-latest
- uses: actions/download-artifact@v8
with:
path: dist_all
name: wheels-ubuntu-24.04-arm
- uses: actions/download-artifact@v8
with:
path: dist_all
name: wheels-macos-15-intel
- uses: actions/download-artifact@v8
with:
path: dist_all
name: wheels-macos-latest
- uses: actions/download-artifact@v8
with:
path: dist_all
name: sdist
- run: |
shopt -s nullglob
for f in dist_all/*.zip; do
unzip -o "$f" -d dist_all/
done
- run: |
python -m pip install --upgrade twine
twine check dist_all/*
twine upload dist_all/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_DEPLOY_KEY }}