forked from LibreCAD/LibreCAD
-
Notifications
You must be signed in to change notification settings - Fork 2
309 lines (273 loc) · 8.05 KB
/
build-all.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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
name: Continuous build
on:
push:
branches:
- master
- ci_dev
jobs:
BuildLinux:
runs-on: ubuntu-22.04
env:
platform_version: 22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Qt and dependencies
run: |
sudo apt-get -y update
sudo apt-get -qq install qtbase5-dev libqt5svg5-dev qt5-qmake qtbase5-dev-tools qttools5-dev-tools qtchooser libgl-dev libmuparser-dev libboost-dev librsvg2-bin libfreetype6-dev libicu-dev pkg-config libfuse2
sudo ln -snf /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf /usr/lib/x86_64-linux-gnu/qtchooser/default.conf
sudo rm -rf /usr/local/lib/android
- name: Install Clang
run: |
sudo apt-get -qq install clang-15 clang-tools-15
- name: Build and analyze
run: |
export CC=g++
export ANALYZE="scan-build-15 -o out --use-cc=g++ --use-analyzer=/usr/bin/clang++ "
${ANALYZE}qmake -r librecad.pro CONFIG+=debug_and_release PREFIX=/usr
${ANALYZE}make release -j$(nproc)
- name: Create report repository
run: |
cd out
find . -mindepth 2 -type f -print -exec mv {} . \;
git config --global user.email "[email protected]"
git config --global user.name "GHA CI [bot]"
git config --global init.defaultBranch gh-pages
git init
git add .
git commit -m "latest analyzer report"
- name: Push changes
if: github.repository_owner == 'LibreCAD'
uses: ad-m/github-push-action@master
with:
repository: ${{ github.repository_owner }}/static-analyzer-reports
github_token: ${{ secrets.LC_PUSH_ANALYZER_REPORT }}
branch: gh-pages
force: true
directory: out
- name: Create AppImage
run: |
find unix/
./CI/build-appimg.sh
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: assets
path: LibreCAD*.AppImage
retention-days: 2
BuildMacOS:
runs-on: macos-11
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Qt5
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
modules: 'qtscript'
- name: Install Qt5 and dependencies
run: |
brew install boost
- name: Build and packaging
run: |
scripts/build-osx.sh
mv LibreCAD.dmg LibreCAD-`git describe --always`.dmg
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: assets
path: LibreCAD*.dmg
retention-days: 2
BuildWindows:
runs-on: windows-2019
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Uninstall incorrect mingw
run: |
choco uninstall mingw --force
choco uninstall strawberryperl --force
- name: Install MinGW8.1 32-bit
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
- name: Install Qt-5.15
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
host: 'windows'
target: 'desktop'
arch: 'win32_mingw81'
dir: '..'
install-deps: 'true'
cache: 'false'
cache-key-prefix: 'install-qt-action'
setup-python: 'true'
set-env: 'true'
tools-only: 'false'
aqtversion: '==3.1.*'
py7zrversion: '==0.20.*'
extra: '--external 7z'
- name: Install boost
shell: bash
run: |
curl -# -L -o boost.7z https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.7z
7z x -o. -y boost.7z
mv boost_1_75_0 ../boost
rm boost.7z
- name: Debugging
if: ${{ always() }}
shell: cmd
run: |
set
echo.
dir c:\
echo.
dir d:\
echo.
dir d:\a
echo.
dir
echo.
dir ..
echo.
dir ..\boost
echo.
dir ..\Qt
echo.
dir ..\Qt\5.15.2\
echo.
dir ..\Qt\5.15.2\mingw81_32\
echo.
dir ..\Qt\5.15.2\mingw81_32\bin
- name: Build
run: |
set PATH=c:\msys64\mingw32\bin;%PATH%
copy CI\custom-win.pri custom.pri
copy CI\custom-win.nsh scripts\postprocess-windows\custom.nsh
echo SET:
set
pushd "${{ github.workspace }}\scripts"
build-windows.bat
shell: cmd
- name: Rename installer
run: |
mv generated/LibreCAD-Installer.exe LibreCAD-Installer-`git describe --always`.exe
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: assets
path: LibreCAD-Installer*.exe
retention-days: 2
BuildWindows64:
runs-on: windows-2019
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Uninstall incorrect mingw
run: |
choco uninstall mingw --force
choco uninstall strawberryperl --force
- name: Install MinGW8.1 64-bit
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
- name: Install Qt-5.15
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
host: 'windows'
target: 'desktop'
arch: 'win64_mingw81'
dir: '..'
install-deps: 'true'
cache: 'false'
cache-key-prefix: 'install-qt-action'
setup-python: 'true'
set-env: 'true'
tools-only: 'false'
aqtversion: '==3.1.*'
py7zrversion: '==0.20.*'
extra: '--external 7z'
- name: Install boost
shell: bash
run: |
curl -# -L -o boost.7z https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.7z
7z x -o. -y boost.7z
mv boost_1_75_0 ../boost
rm boost.7z
- name: Debugging
if: ${{ always() }}
shell: cmd
run: |
set
echo.
dir c:\
echo.
dir d:\
echo.
dir d:\a
echo.
dir
echo.
dir ..
echo.
dir ..\boost
echo.
dir ..\Qt
echo.
dir ..\Qt\5.15.2\
echo.
dir ..\Qt\5.15.2\mingw81_64\
echo.
dir ..\Qt\5.15.2\mingw81_64\bin
- name: Build
run: |
set PATH=C:\msys64\mingw64\bin;%PATH%
copy CI\custom-win.pri custom.pri
copy CI\custom-win-x64.nsh scripts\postprocess-windows\custom.nsh
echo SET:
set
pushd "${{ github.workspace }}\scripts"
build-windows.bat
shell: cmd
- name: Rename installer
run: |
mv generated/LibreCAD-Installer.exe LibreCAD-Installer-x64-`git describe --always`.exe
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: assets
path: LibreCAD-Installer*.exe
retention-days: 2
UpdateAssets:
if: github.repository_owner == 'LibreCAD'
needs: [BuildLinux, BuildMacOS, BuildWindows, BuildWindows64]
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch artifacts
uses: actions/download-artifact@v3
- name: Upload latest pre-release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
title: "Continuous Build"
files: |
assets/LibreCAD*.*
LICENSE