-
Notifications
You must be signed in to change notification settings - Fork 10
248 lines (212 loc) · 6.15 KB
/
package.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
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
name: packaging
on:
push:
branch-ignore:
- '*'
tags:
- 'v?\d+.\d+.\d+'
- 'dev*'
- 'pack*'
jobs:
# ------ #
# Ubuntu #
# ------ #
build-ubuntu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
steps:
- uses: actions/checkout@v3
name: Checkout TTK-ParaView source code
- name: Install Ubuntu dependencies
run: |
sudo apt update
# TTK-ParaView dependencies
sudo apt install -y \
qtbase5-dev \
qtchooser \
qt5-qmake \
qtbase5-dev-tools \
qttools5-dev \
qtxmlpatterns5-dev-tools \
libqt5x11extras5-dev \
libqt5svg5-dev \
libgl1-mesa-dev \
libxcursor-dev \
ninja-build \
dpkg-dev
- name: Create & configure ParaView build directory
run: |
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DPARAVIEW_PYTHON_SITE_PACKAGES_SUFFIX=lib/python3/dist-packages \
-GNinja \
$GITHUB_WORKSPACE
- name: Build ParaView
run: |
cd build
cmake --build . --parallel
- name: Create ParaView package
run: |
cd build
cpack -G DEB
- name: Upload Debian package
uses: actions/upload-artifact@v3
with:
name: ttk-paraview-${{ matrix.os }}
path: build/ttk-paraview.deb
# ----- #
# macOS #
# ----- #
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
name: Checkout TTK-ParaView source code
- name: Remove hosted Python
run: |
sudo rm -rf /usr/local/Frameworks/Python.framework
- name: Install macOS dependencies
run: |
# ParaView dependencies
brew install --cask xquartz
brew install wget libomp mesa glew qt@5 ninja python
- name: Create & configure ParaView build directory
run: |
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5 \
-DPython3_ROOT_DIR=$(brew --prefix python) \
-GNinja \
$GITHUB_WORKSPACE
- name: Build ParaView
run: |
cd build
cmake --build . --parallel
- name: Create ParaView package
run: |
cd build
cpack -G TGZ
- name: Upload compressed binaries
uses: actions/upload-artifact@v3
with:
name: ttk-paraview-macOS
path: build/ttk-paraview.tar.gz
# ------- #
# Windows #
# ------- #
build-windows:
runs-on: windows-2022
env:
CONDA_ROOT: C:\Miniconda
steps:
- uses: actions/checkout@v3
name: Checkout TTK-ParaView source code
- uses: s-weigand/setup-conda@v1
- name: Install dependencies with conda
shell: bash
run: |
conda install -c conda-forge "qt>=5.12"
- name: Remove hosted Python
shell: bash
run: |
rm -rf C:/hostedtoolcache/windows/Python
- name: Create & configure ParaView build directory
shell: cmd
run: |
cd ..
mkdir b
cd b
cmake ^
-DPython3_ROOT_DIR="%CONDA_ROOT%" ^
-DCMAKE_AUTOUIC=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
-G"Visual Studio 17 2022" ^
%GITHUB_WORKSPACE%
- name: Build ParaView
shell: cmd
run: |
cd ..\b
cmake --build . --config Release --parallel
- name: Create ParaView package
shell: bash
run: |
cd ../b
cpack -G NSIS64
mv ttk-paraview.exe $GITHUB_WORKSPACE
- name: Upload install executable
uses: actions/upload-artifact@v3
with:
name: ttk-paraview-windows
path: ttk-paraview.exe
# --------------------- #
# Upload release assets #
# --------------------- #
create-release:
runs-on: ubuntu-latest
needs: [build-ubuntu, build-macos, build-windows]
steps:
- name: Delete previous release
uses: actions/github-script@v6
continue-on-error: true
with:
script: |
const { owner, repo } = context.repo
const { data: { id } } = await github.rest.repos.getReleaseByTag({
owner,
repo,
tag: "${{ github.ref_name }}"
})
await github.rest.repos.deleteRelease({ owner, repo, release_id: id })
- name: Create Release
uses: actions/github-script@v6
with:
script: |
const { owner, repo } = context.repo
await github.rest.repos.createRelease({
owner,
repo,
tag_name: "${{ github.ref_name }}",
name: "Release ${{ github.ref_name }}",
draft: false,
prerelease: false
})
- name: Fetch all uploaded artifacts
uses: actions/download-artifact@v3
- name: Upload Ubuntu Focal .deb as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-paraview-ubuntu-20.04/ttk-paraview.deb
asset_name: ttk-paraview-$tag-ubuntu-20.04.deb
- name: Upload Ubuntu Jammy .deb as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-paraview-ubuntu-22.04/ttk-paraview.deb
asset_name: ttk-paraview-$tag-ubuntu-22.04.deb
- name: Upload .tar.gz as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-paraview-macOS/ttk-paraview.tar.gz
asset_name: ttk-paraview-$tag.tar.gz
- name: Upload .exe as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-paraview-windows/ttk-paraview.exe
asset_name: ttk-paraview-$tag.exe
- name: Delete package artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: |
ttk-paraview*