-
Notifications
You must be signed in to change notification settings - Fork 18
280 lines (272 loc) · 11.9 KB
/
main.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
name: Build
on:
push:
branches: "*"
tags:
- "[0-9].[0-9].[0-9]"
jobs:
build_windows:
name: Build for Windows
runs-on: windows-latest
steps:
- name: Set up MSVC Environment
uses: compnerd/gha-setup-vsdevenv@main
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: "6.5.*"
modules: qtmultimedia
- name: Install Taglib
run: |
git clone --recurse-submodules https://github.com/taglib/taglib.git
cd taglib
cmake -B build -G "Visual Studio 17 2022" -A x64 -DWITH_ZLIB=OFF -DBUILD_SHARED_LIBS=ON -DENABLE_STATIC_RUNTIME=OFF -DBUILD_TESTING=OFF
msbuild build/install.vcxproj -p:Configuration=Release
cp -r "C:/Program Files/taglib/include/taglib" ../include
copy build/taglib/Release/tag.dll ../lib/win64
copy build/taglib/Release/tag.lib ../lib/win64
- name: Install ZenLib
run: |
git clone https://github.com/MediaArea/ZenLib.git
cd ZenLib
cmake -S Project/CMake -B build -G "Visual Studio 17 2022" -A x64
msbuild build/install.vcxproj -p:Configuration=Release
- name: Install zlib
run: |
git clone https://github.com/MediaArea/zlib.git
cd zlib
cmake -B build -G "Visual Studio 17 2022" -A x64
msbuild build/install.vcxproj -p:Configuration=Release
- name: Install libmediainfo
run: |
git clone https://github.com/MediaArea/MediaInfoLib.git
cd MediaInfoLib
cmake -S Project/CMake -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release
msbuild build/install.vcxproj -p:Configuration=Release
- name: Install cld2
run: |
cd include/cld2/internal
cl /TP /GR /EHsc /c /MD cldutil.cc cldutil_shared.cc compact_lang_det.cc compact_lang_det_hint_code.cc compact_lang_det_impl.cc debug.cc fixunicodevalue.cc generated_entities.cc generated_language.cc generated_ulscript.cc getonescriptspan.cc lang_script.cc offsetmap.cc scoreonescriptspan.cc tote.cc utf8statetable.cc cld_generated_cjk_uni_prop_80.cc cld2_generated_cjk_compatible.cc cld_generated_cjk_delta_bi_32.cc generated_distinct_bi_0.cc cld2_generated_quad0122.cc cld2_generated_deltaocta0122.cc cld2_generated_distinctocta0122.cc cld_generated_score_quad_octa_0122.cc
link /dll /out:cld2.dll *.obj
lib /out:cld2.lib *.obj
copy cld2.lib ../../../lib/win64
copy cld2.dll ../../../lib/win64
- name: Build plugins
run: |
cd src/plugins/audiotag/
qmake audiotag.pro -spec win32-msvc
nmake
cd ../cleanup
qmake6 cleanup.pro -spec win32-msvc
nmake
cd ../lyric
qmake6 lyric.pro -spec win32-msvc
nmake
cd ../preparatory
qmake6 preparatory.pro -spec win32-msvc
nmake
cd ../rename
qmake6 rename.pro -spec win32-msvc
nmake
- name: Build UltraStar-Manager
run: |
cp "C:/Program Files/taglib/bin/tag.dll" bin/release/
cp "C:/Program Files/zlib/bin/zlib.dll" bin/release/
cp lib/win64/cld2.dll bin/release/
cd src
qmake6 UltraStar-Manager.pro -spec win32-msvc
nmake
- name: Create installer
uses: joncloud/[email protected]
with:
script-file: setup/win64/UltraStar-Manager.nsi
- name: Upload Portable Artifact
uses: actions/upload-artifact@v4
with:
name: WIN64-UltraStar-Manager-portable
path: bin/release
if-no-files-found: error
- name: Upload Installer Artifact
uses: actions/upload-artifact@v4
with:
name: WIN64-UltraStar-Manager-installer
path: bin/UltraStar-Manager*-setup.exe
if-no-files-found: error
build_mac:
name: Build for MacOS (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, macos-14]
fail-fast: false
steps:
- name: Get Number of CPU Cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Determine Arch
run: |
if [ "${{ matrix.os }}" = "macos-13" ]; then
echo "arch=x86" >> $GITHUB_ENV
else
echo "arch=ARM" >> $GITHUB_ENV
fi
- name: Install Dependencies
run: |
brew unlink [email protected] && brew link --overwrite [email protected]
brew install qt
brew install taglib
brew install libmediainfo
brew install create-dmg
- name: Install cld2
run: |
mkdir lib/MacOS
cd include
patch cld2/internal/compile_libs.sh cld2-mac-compile.patch
cd cld2/internal/
export CFLAGS="-Wno-narrowing -O3"
./compile_libs.sh
cp libcld2.dylib ../../../lib/MacOS
- name: Fix Qt lib rpaths # see: https://github.com/orgs/Homebrew/discussions/2823#discussioncomment-2010340)
run: |
install_name_tool -id '@rpath/QtCore.framework/Versions/A/QtCore' $(brew --prefix)/lib/QtCore.framework/Versions/A/QtCore
install_name_tool -id '@rpath/QtGui.framework/Versions/A/QtGui' $(brew --prefix)/lib/QtGui.framework/Versions/A/QtGui
install_name_tool -id '@rpath/QtNetwork.framework/Versions/A/QtNetwork' $(brew --prefix)/lib/QtNetwork.framework/Versions/A/QtNetwork
install_name_tool -id '@rpath/QtWidgets.framework/Versions/A/QtWidgets' $(brew --prefix)/lib/QtWidgets.framework/Versions/A/QtWidgets
install_name_tool -id '@rpath/QtPdf.framework/Versions/A/QtPdf' $(brew --prefix)/lib/QtPdf.framework/Versions/A/QtPdf
install_name_tool -id '@rpath/QtSvg.framework/Versions/A/QtSvg' $(brew --prefix)/lib/QtSvg.framework/Versions/A/QtSvg
install_name_tool -id '@rpath/QtVirtualKeyboard.framework/Versions/A/QtVirtualKeyboard' $(brew --prefix)/lib/QtVirtualKeyboard.framework/Versions/A/QtVirtualKeyboard
install_name_tool -id '@rpath/QtQuick.framework/Versions/A/QtQuick' $(brew --prefix)/lib/QtQuick.framework/Versions/A/QtQuick
install_name_tool -id '@rpath/QtQmlModels.framework/Versions/A/QtQmlModels' $(brew --prefix)/lib/QtQmlModels.framework/Versions/A/QtQmlModels
install_name_tool -id '@rpath/QtQml.framework/Versions/A/QtQml' $(brew --prefix)/lib/QtQml.framework/Versions/A/QtQml
install_name_tool -id '@rpath/QtOpenGL.framework/Versions/A/QtOpenGL' $(brew --prefix)/lib/QtOpenGL.framework/Versions/A/QtOpenGL
install_name_tool -id '@rpath/QtMultimedia.framework/Versions/A/QtMultimedia' $(brew --prefix)/lib/QtMultimedia.framework/Versions/A/QtMultimedia
- name: Build plugins
run: |
cd src/plugins/audiotag/
qmake6 audiotag.pro
make -j${{ steps.cpu-cores.outputs.count }}
cd ../cleanup/
qmake6 cleanup.pro
make -j${{ steps.cpu-cores.outputs.count }}
cd ../lyric/
qmake6 lyric.pro
make -j${{ steps.cpu-cores.outputs.count }}
cd ../preparatory/
qmake6 preparatory.pro
make -j${{ steps.cpu-cores.outputs.count }}
cd ../rename/
qmake6 rename.pro
make -j${{ steps.cpu-cores.outputs.count }}
- name: Build UltraStar-Manager
run: |
cd src
qmake6 UltraStar-Manager.pro
make -j$${{ steps.cpu-cores.outputs.count }}
cd ../bin/release
mv UltraStar-Manager.dmg MAC-${{ env.arch }}-UltraStar-Manager.dmg
- name: Upload Portable Artifact
uses: actions/upload-artifact@v4
with:
name: MAC-${{ env.arch }}-UltraStar-Manager-portable
path: bin/release
if-no-files-found: error
- name: Upload Image Artifact
uses: actions/upload-artifact@v4
with:
name: MAC-${{ env.arch }}-UltraStar-Manager-image
path: bin/release/MAC-${{ env.arch }}-UltraStar-Manager.dmg
if-no-files-found: error
build_linux:
name: Build for Linux
runs-on: ubuntu-20.04
steps:
- name: Get Number of CPU Cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: "6.5.*"
modules: qtmultimedia
- name: Install Dependencies
run: |
sudo apt update -qq
sudo apt install -y libgl1-mesa-dev build-essential libpulse-mainloop-glib0 libgstreamer-plugins-base1.0-dev
sudo apt install -y libtag1-dev libcld2-dev libmediainfo-dev
sudo apt install -y libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb-dev libxkbcommon-x11-0 libxcb-cursor0 libgtk2.0-dev
- name: Build plugins
run: |
cd src/plugins/audiotag/
qmake6 audiotag.pro
make -j${{ steps.cpu-cores.outputs.count }}
cd ../cleanup/
qmake6 cleanup.pro
make -j${{ steps.cpu-cores.outputs.count }}
cd ../lyric/
qmake6 lyric.pro
make -j${{ steps.cpu-cores.outputs.count }}
cd ../preparatory/
qmake6 preparatory.pro
make -j${{ steps.cpu-cores.outputs.count }}
cd ../rename/
qmake6 rename.pro
make -j${{ steps.cpu-cores.outputs.count }}
- name: Build UltraStar-Manager
run: |
cd src
qmake6 UltraStar-Manager.pro
make -j${{ steps.cpu-cores.outputs.count }}
- name: Create AppImage
run: |
cd bin/release
wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x linuxdeployqt*.AppImage
cp ../../setup/unix/UltraStar-Manager.desktop .
cp ../../setup/unix/UltraStar-Manager.png .
sed -i "s/Name=UltraStar-Manager/Name=LINUX-UltraStar-Manager/g" UltraStar-Manager.desktop
./linuxdeployqt*.AppImage UltraStar-Manager.desktop -bundle-non-qt-libs -appimage
mv LINUX-UltraStar-Manager-*.AppImage LINUX-UltraStar-Manager.AppImage
- name: Upload AppImage Artifact
uses: actions/upload-artifact@v4
with:
name: LINUX-UltraStar-Manager-appimage
path: bin/release/LINUX-UltraStar-Manager.AppImage
if-no-files-found: error
draft_release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
name: Draft a Release
needs: [build_windows, build_mac, build_linux]
runs-on: ubuntu-20.04
steps:
- name: Download Artifacts from Build Jobs
uses: actions/download-artifact@v4
with:
path: .
pattern: "*"
- name: Prepare Artifacts
run: |
zip -r MAC-x86-UltraStar-Manager-portable.zip MAC-x86-UltraStar-Manager-portable
zip -r MAC-ARM-UltraStar-Manager-portable.zip MAC-ARM-UltraStar-Manager-portable
zip -r WIN64-UltraStar-Manager-portable.zip WIN64-UltraStar-Manager-portable
mv WIN64-UltraStar-Manager-installer/UltraStar-Manager* WIN64-UltraStar-Manager-installer/WIN64-UltraStar-Manager-setup.exe
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "LINUX-UltraStar-Manager-appimage/*, MAC-x86-UltraStar-Manager-image/*, MAC-x86-UltraStar-Manager-portable.zip, MAC-ARM-UltraStar-Manager-image/*, MAC-ARM-UltraStar-Manager-portable.zip, WIN64-UltraStar-Manager-installer/*, WIN64-UltraStar-Manager-portable.zip"
draft: true
artifactErrorsFailBuild: true