-
Notifications
You must be signed in to change notification settings - Fork 64
266 lines (264 loc) · 11 KB
/
build.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
name: Build CI
on:
push:
release:
types: [published]
jobs:
build:
strategy:
matrix:
qt_version: [5.14.2]
platform: [ubuntu-16.04, macos-latest, windows-latest]
arch: [x86, x64]
include:
- platform: windows-latest
arch: x86
qtarch: win32_msvc2017
cmakearch: Win32
- platform: windows-latest
arch: x64
qtarch: win64_msvc2017_64
cmakearch: x64
exclude:
- platform: ubuntu-16.04
arch: x86
- platform: macos-latest
arch: x86
fail-fast: false
runs-on: ${{ matrix.platform }}
steps:
- name: Checking out sources
uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Install MSVC compiler
uses: ilammy/msvc-dev-cmd@v1
with:
# 14.1 is for vs2017, 14.2 is vs2019, following the upstream vcpkg build from Qv2ray-deps repo
toolset: 14.2
arch: ${{ matrix.arch }}
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: QtCache-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.qt_version }}
- name: Installing Qt - ${{ matrix.arch }}
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt_version }}
arch: ${{ matrix.qtarch }}
mirror: "http://mirrors.ocf.berkeley.edu/qt/"
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Install Python 3.7 version
if: matrix.platform == 'windows-latest'
uses: actions/setup-python@v1
with:
python-version: "3.7"
architecture: ${{ matrix.arch }}
- name: Get the version
id: get_version
shell: bash
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
# Linux------------------------------------------
- name: Linux - Install packages
if: matrix.platform == 'ubuntu-16.04'
shell: bash
env:
CC: /usr/bin/gcc-9
CXX: /usr/bin/g++-9
run: |
sudo apt install libgl-dev libx11-dev libxkbcommon-x11-dev ninja-build
- name: Linux - Build ecm
if: matrix.platform == 'ubuntu-16.04'
shell: bash
env:
CC: /usr/bin/gcc-9
CXX: /usr/bin/g++-9
run: |
cd src/3rdparty/extra-cmake-modules
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr
cmake --build . --parallel $(nproc)
sudo cmake --build . --target install
- name: Linux - Build SyntaxHighlighting
if: matrix.platform == 'ubuntu-16.04'
shell: bash
env:
CC: /usr/bin/gcc-9
CXX: /usr/bin/g++-9
run: |
cd src/3rdparty/syntax-highlighting
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr
cmake --build . --parallel $(nproc)
sudo cmake --build . --target install
- name: Linux - ${{ matrix.qt_version }} - Generate Dependencies and Build
if: matrix.platform == 'ubuntu-16.04'
shell: bash
env:
CC: /usr/bin/gcc-9
CXX: /usr/bin/g++-9
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./AppDir/usr
cmake --build . --parallel $(nproc)
cmake --install .
- name: Linux - ${{ matrix.qt_version }} - Generating AppImage
if: matrix.platform == 'ubuntu-16.04'
shell: bash
env:
CC: /usr/bin/gcc-9
CXX: /usr/bin/g++-9
run: |
cd build
wget https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage
chmod +x ./linuxdeployqt-6-x86_64.AppImage
./linuxdeployqt-6-x86_64.AppImage --appimage-extract
cd AppDir
wget -c https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/AppRun-patched-x86_64 -O AppRun
chmod a+x AppRun
mkdir -p ./usr/{lib,optional}/
wget -c https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/exec-x86_64.so -O ./usr/optional/exec.so
mkdir -p ./usr/optional/libstdc++/
cp -fv /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./usr/optional/libstdc++/
mkdir -p ./usr/optional/libgcc_s/
cp -fv /lib/x86_64-linux-gnu/libgcc_s.so.1 ./usr/optional/libgcc_s/
cp -fv /usr/lib/x86_64-linux-gnu/{libssl.so.1.1,libcrypto.so.1.1} ./usr/lib/
cd ..
squashfs-root/AppRun AppDir/usr/share/applications/notepanda.desktop -appimage -no-strip -always-overwrite
mv ./Notepanda*.AppImage ./Notepanda.AppImage
- name: Linux - ${{ matrix.qt_version }} - Uploading artifact
if: matrix.platform == 'ubuntu-16.04'
uses: actions/upload-artifact@master
with:
name: Notepanda-${{ github.sha }}.Linux-${{ matrix.arch }}.qt${{ matrix.qt_version }}.AppImage
path: build/Notepanda.AppImage
- name: Linux - ${{ matrix.qt_version }} - Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release' && matrix.platform == 'ubuntu-16.04' && matrix.qt_version == '5.14.2'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/Notepanda.AppImage
asset_name: Notepanda.${{ steps.get_version.outputs.VERSION }}.Linux-${{ matrix.arch }}.AppImage
tag: ${{ github.ref }}
overwrite: true
# Windows----------------------------------------------------------------------
# - name: Win-${{ matrix.arch }} - ${{ matrix.qt_version }} - Build preparation - Download Dependencies
# if: matrix.platform == 'windows-latest'
# run: |
# choco install -y ninja
- name: Setup Ninja
if: matrix.platform == 'windows-latest'
uses: ashutoshvarma/setup-ninja@master
with:
# ninja version to download. Default: 1.10.0
version: 1.10.0
- name: Win - Build ecm
if: matrix.platform == 'windows-latest'
env:
CC: cl.exe
CXX: cl.exe
run: |
set VCINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio 16.0\VC"
cd src/3rdparty/extra-cmake-modules
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF
cmake --build . --parallel $(nproc)
cmake --build . --target install
- name: Win - Build syntax highlight
if: matrix.platform == 'windows-latest'
env:
CC: cl.exe
CXX: cl.exe
run: |
cd src/3rdparty/syntax-highlighting
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF
cmake --build . --parallel $(nproc)
cmake --build . --target install
- name: Windows - ${{ matrix.qt_version }} - Generate Dependencies and Build
if: matrix.platform == 'windows-latest'
env:
CC: cl.exe
CXX: cl.exe
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=Release -DKF5SyntaxHighlighting_DIR="C:/Program Files (x86)/ECM/lib/cmake/KF5SyntaxHighlighting"
cmake --build . --parallel $(nproc)
cmake --install .
cd Release
windeployqt notepanda.exe --no-translations
- name: Win - ${{ matrix.arch }} - ${{ matrix.qt_version }} - Create 7z Release
if: matrix.platform == 'windows-latest'
uses: DuckSoft/[email protected]
with:
pathSource: ./build/Release
pathTarget: ./release.7z
- name: Win - ${{ matrix.arch }} - ${{ matrix.qt_version }} - Uploading artifact
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@master
with:
name: Notepanda-${{ github.sha }}.Windows-${{ matrix.arch }}.qt${{ matrix.qt_version }}.7z
path: release.7z
- name: Win - ${{ matrix.arch }} - ${{ matrix.qt_version }} - Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release' && matrix.platform == 'windows-latest' && matrix.qt_version == '5.14.2'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: release.7z
asset_name: Notepanda.${{ steps.get_version.outputs.VERSION }}.Windows-${{ matrix.arch }}.7z
tag: ${{ github.ref }}
overwrite: true
# MacOS ---------------------------------------------------------
- name: MacOS - Build ecm
if: matrix.platform == 'macos-latest'
shell: bash
run: |
brew install ninja
cd src/3rdparty/extra-cmake-modules
mkdir build
cd build
cmake .. -GNinja -DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF
cmake --build .
cmake --build . --target install
- name: MacOS - Build syntax highlight
if: matrix.platform == 'macos-latest'
run: |
cd src/3rdparty/syntax-highlighting
mkdir build
cd build
cmake .. -GNinja -DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF -DBUILD_QTHELP_DOCS=OFF -DBUILD_TESTING=OFF
cmake --build .
sudo cmake --build . --target install
- name: macOS - ${{ matrix.qt_version }} - Generate Dependencies and Build
if: matrix.platform == 'macos-latest'
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DDS_STORE_SCRIPT=ON
cmake --build .
sudo cmake --install .
macdeployqt notepanda.app -dmg
- name: macOS - ${{ matrix.qt_version }} - Uploading Artifact
if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@master
with:
name: Notepanda-${{ github.sha }}.macOS-${{ matrix.arch }}.qt${{ matrix.qt_version }}.dmg
path: build/notepanda.dmg
- name: macOS - ${{ matrix.qt_version }} - Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release' && matrix.platform == 'macos-latest' && matrix.qt_version == '5.14.2'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/notepanda.dmg
asset_name: Notepanda-${{ steps.get_version.outputs.VERSION }}.macOS-${{ matrix.arch }}.dmg
tag: ${{ github.ref }}
overwrite: true
# END