-
Notifications
You must be signed in to change notification settings - Fork 21
329 lines (329 loc) · 13.7 KB
/
ci.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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
name: CI
on:
push:
paths:
- "*.pro"
- "package/**"
- "src/**"
- ".github/workflows/ci.yml"
pull_request:
paths:
- "*.pro"
- "package/**"
- "src/**"
- ".github/workflows/ci.yml"
jobs:
create-release:
if: ${{ !startsWith(github.event.ref, 'refs/tags/') }}
name: Create Pre-Release
runs-on: ubuntu-latest
needs:
- build-on-ubuntu
- build-on-win-mingw
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
submodules: recursive
- name: Set Env
shell: bash
run: |
export VERSION=$(grep -o '".*"' src/version.h | sed 's/"//g')-build.$GITHUB_RUN_NUMBER
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: etc/usr/artifacts/
- name: Process artifacts
run: |
mkdir -p /home/runner/work/modmanager/modmanager/etc/usr/publish
cd /home/runner/work/modmanager/modmanager/etc/usr/artifacts/ModManager-${{ env.VERSION }}-x64-packed
zip -q -r ModManager-${{ env.VERSION }}-x64-packed.zip *
mv ModManager-${{ env.VERSION }}-x64-packed.zip /home/runner/work/modmanager/modmanager/etc/usr/publish/ModManager-${{ env.VERSION }}-x64-packed.zip
mv /home/runner/work/modmanager/modmanager/etc/usr/artifacts/ModManager-${{ env.VERSION }}-x64-Installer.exe/ModManager-Installer.exe /home/runner/work/modmanager/modmanager/etc/usr/publish/ModManager-${{ env.VERSION }}-x64-Installer.exe
# mv /home/runner/work/modmanager/modmanager/etc/usr/artifacts/ModManager-${{ env.VERSION }}.dmg/modmanager.dmg /home/runner/work/modmanager/modmanager/etc/usr/publish/ModManager-${{ env.VERSION }}.dmg
mv /home/runner/work/modmanager/modmanager/etc/usr/artifacts/ModManager-${{ env.VERSION }}-x86_64.AppImage/Mod_Manager-${{ env.VERSION }}-x86_64.AppImage /home/runner/work/modmanager/modmanager/etc/usr/publish/ModManager-${{ env.VERSION }}.AppImage
- name: Get short commit sha
id: get_short_sha
run: |
short_sha=$(echo ${GITHUB_SHA} | cut -c1-7)
echo "::set-output name=short_sha::$short_sha"
- name: Create Github release
uses: marvinpinto/action-automatic-releases@v1.2.1
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.VERSION }}"
prerelease: true
title: "Mod Manager Dev ${{ env.VERSION }} (${{ steps.get_short_sha.outputs.short_sha }})"
files: |
etc/usr/publish/**
build-on-ubuntu:
name: Build On Ubuntu
runs-on: ubuntu-24.04 # for libquazip1-qt5 available
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 5.15.2
modules: qtwebengine
- name: ubuntu install packages
run: |
sudo apt update
sudo apt-get install -y libglew-dev libglfw3-dev
sudo apt-get install -y libaria2-0-dev libquazip1-qt5-dev
sudo apt install -y libgl-dev libx11-dev libxkbcommon-x11-dev libxcb-util1 libxcb-image0-dev libxcb-icccm4-dev libssl-dev libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0
sudo apt install -y libprotobuf-dev protobuf-compiler protobuf-c-compiler libgrpc++-dev protobuf-compiler-grpc ninja-build fcitx-frontend-qt5 libcurl4-openssl-dev
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Set Env
run: |
export ARCH=x86_64
export RAW_VERSION=$(grep -o '".*"' src/version.h | sed 's/"//g')
export VERSION=$RAW_VERSION-build.$GITHUB_RUN_NUMBER
export RELEASE_TEXT=$(grep -Pzo "### ${VERSION}\n(\n|.)+?\n##" Changelog.md | sed '$ d')
echo "RAW_VERSION=${RAW_VERSION}" >> $GITHUB_ENV
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "RELEASE_TEXT<<EOF" >> $GITHUB_ENV
echo "${RELEASE_TEXT}" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Modify version number
if: ${{ !startsWith(github.event.ref, 'refs/tags/') }}
shell: bash
run: |
sed -i "s/$RAW_VERSION/$VERSION/" src/version.h
- name: build ubuntu
run: |
export PKG_CONFIG_PATH='/usr/lib/x86_64-linux-gnu/pkgconfig/'
qmake
make
- name: package
run: |
make INSTALL_ROOT=AppDir -j2 install ; find AppDir/
wget -c -nv https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2) #Thanks to github page change.
chmod +x appimagetool-*.AppImage
sudo mkdir -p /home/qt/work/install
sudo ln -s $QT_PLUGIN_PATH /home/qt/work/install/plugins
./appimagetool-*.AppImage -s deploy AppDir/usr/share/applications/*.desktop
./appimagetool-*.AppImage AppDir
- uses: actions/upload-artifact@v2
with:
name: ModManager-${{ env.VERSION }}-x86_64.AppImage
path: Mod_Manager*.AppImage
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: Mod_Manager-${{ env.VERSION }}-x86_64.AppImage
asset_name: ModManager-${{ env.VERSION }}-x86_64.AppImage
tag: ${{ github.ref }}
body: ${{ env.RELEASE_TEXT }}
overwrite: true
build-on-win-mingw:
name: Build On Windows Mingw
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
# - qt_arch: win64_mingw
# qt_ver: 6.7.1
# modules: qt5compat
- qt_arch: win64_mingw81
qt_ver: 5.15.2
qt_tools_mingw_install: mingw810_64
modules:
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
host: 'windows'
target: 'desktop'
version: ${{ matrix.qt_ver }}
arch: ${{ matrix.qt_arch }}
modules: ${{ matrix.modules }}
- uses: actions/checkout@v2
with:
fetch-depth: 1
submodules: recursive
- name: Set Env
shell: bash
run: |
export RAW_VERSION=$(grep -o '".*"' src/version.h | sed 's/"//g')
export VERSION=$RAW_VERSION-build.$GITHUB_RUN_NUMBER
echo "RAW_VERSION=${RAW_VERSION}" >> $GITHUB_ENV
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Modify version number
if: ${{ !startsWith(github.event.ref, 'refs/tags/') }}
shell: bash
run: |
sed -i "s/$RAW_VERSION/$VERSION/" src/version.h
- name: Install dependencies for Qt 5
if: ${{ startsWith( matrix.qt_ver, 5 ) }}
shell: powershell
run: |
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-aria2 --noconfirm
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-quazip-qt5 --noconfirm
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-pkg-config --noconfirm
C:/msys64/usr/bin/pacman -Q
- name: Install dependencies for Qt 6
if: ${{ startsWith( matrix.qt_ver, 6 ) }}
shell: powershell
run: |
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-aria2 --noconfirm
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-quazip-qt6 --noconfirm
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-pkg-config --noconfirm
- name: environment configuration
shell: pwsh
run: |
Write-Output "${{ env.QT_ROOT_DIR }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Write-Output "${{ env.QT_ROOT_DIR }}/../../Tools/${{ matrix.qt_tools_mingw_install }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: where is qmake & where is mingw32-make
shell: pwsh
run: |
Get-Command -Name 'qmake' | Format-List
Get-Command -Name 'mingw32-make' | Format-List
- name: mingw-build
id: build
shell: pwsh
env:
PKG_CONFIG_PATH: 'C:/msys64/mingw64/lib/pkgconfig'
run: |
cp C:/msys64/mingw64/bin/pkg-config.exe ${{ env.QT_ROOT_DIR }}/bin/
qmake
mingw32-make.exe qmake_all
mingw32-make.exe
- name: list msys dll
shell: pwsh
run : |
ls C:/msys64/mingw64/bin
ls ${{ env.QT_ROOT_DIR }}/bin
- name: package
id: package
shell: pwsh
run: |
mkdir deploy
mv release/modmanager.exe deploy
cp C:/msys64/mingw64/bin/libcrypto-3-x64.dll deploy/
cp C:/msys64/mingw64/bin/libbz2-1.dll deploy/
cp C:/msys64/mingw64/bin/libiconv-2.dll deploy/
cp C:/msys64/mingw64/bin/liblzma-5.dll deploy/
cp C:/msys64/mingw64/bin/libintl-8.dll deploy/
cp C:/msys64/mingw64/bin/zlib1.dll deploy/
cp C:/msys64/mingw64/bin/libstdc++-6.dll deploy/
cp C:/msys64/mingw64/bin/libsqlite3-0.dll deploy/
cp C:/msys64/mingw64/bin/libssh2-1.dll deploy/
cp C:/msys64/mingw64/bin/libxml2-2.dll deploy/
cp C:/msys64/mingw64/bin/libgcc_s_seh-1.dll deploy/
windeployqt.exe --no-translations --no-opengl-sw --no-system-d3d-compiler --no-quick-import --qmldir "${{ env.QT_ROOT_DIR }}/qml" deploy/modmanager.exe
- name: aria2 dependencies
shell: pwsh
run: |
iwr "https://github.com/kaniol-lck/modmanager/releases/download/v1.1.1-build.543/ModManager-v1.1.1-build.543-x64-packed.zip" -OutFile ModManager-v1.1.1-build.543-x64-packed.zip
unzip *.zip -d old
cp old/libaria2-0.dll deploy/
cp old/libcares-5.dll deploy/
cp old/libcrypto-1_1-x64.dll deploy/
cp old/libssl-1_1-x64.dll deploy/
- name: qt5 dependencies
if: ${{ startsWith( matrix.qt_ver, 5 ) }}
run : |
cp C:/msys64/mingw64/bin/libquazip1-qt5.dll deploy/
# - name: qt6 dependencies
# if: ${{ startsWith( matrix.qt_ver, 6 ) }}
# run : |
# cp C:/msys64/mingw64/bin/libquazip1-qt6.dll deploy/
# cp C:/msys64/mingw64/bin/libicuuc74.dll deploy/
# cp C:/msys64/mingw64/bin/libicudt74.dll deploy/
# cp C:/msys64/mingw64/bin/Qt6Core5Compat.dll deploy/
- name: Modify NSIS for x64
shell: pwsh
run: |
(Get-Content package/modmanager.nsi).replace('PROGRAMFILES', 'PROGRAMFILES64') | Set-Content package/modmanager.nsi
- name: Create installer
run: |
makensis package/modmanager.nsi
- uses: actions/upload-artifact@v2
with:
name: ModManager-${{ env.VERSION }}-x64-Installer.exe
path: ${{github.workspace}}/package/ModManager*-Installer.exe
- uses: actions/upload-artifact@v2
with:
name: ModManager-${{ env.VERSION }}-x64-packed
path: deploy/*
- name: Upload Release
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: package/ModManager-Installer.exe
asset_name: ModManager-${{ env.VERSION }}-x64-Installer.exe
tag: ${{ github.ref }}
overwrite: true
build-on-osx:
name: Build On OSX
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest]
qt_ver: [5.12.12]
qt_arch: [clang_64]
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==2.1.*'
version: ${{ matrix.qt_ver }}
host: 'mac'
target: 'desktop'
arch: ${{ matrix.qt_arch }}
modules: 'qtwebengine'
- name: Install libaria2
run: |
wget "https://github.com/kaniol-lck/aria2/releases/download/release-1.36.0/libaria2-clang-macos-10.15.zip"
unzip *.zip
csrutil status
sudo cp -r lib/ /usr/local/lib/
sudo cp -r include/aria2/ /usr/local/include/
rm -rf lib/ include/ *.zip
- name: Install dependencies
run: |
brew install quazip gnu-sed aria2
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Set Env
shell: bash
run: |
export RAW_VERSION=$(grep -o '".*"' src/version.h | sed 's/"//g')
export VERSION=$RAW_VERSION-build.$GITHUB_RUN_NUMBER
echo "RAW_VERSION=${RAW_VERSION}" >> $GITHUB_ENV
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Modify version number
if: ${{ !startsWith(github.event.ref, 'refs/tags/') }}
shell: bash
run: |
gsed -i "s/$RAW_VERSION/$VERSION/" src/version.h
- name: build macos
run: |
qmake
make
- name: package
run: |
macdeployqt modmanager.app -qmldir=. -verbose=1 -dmg
shell: sh
- uses: actions/upload-artifact@v2
with:
name: ModManager-${{ env.VERSION }}.dmg
path: modmanager.dmg
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: modmanager.dmg
asset_name: ModManager-${{ env.VERSION }}.dmg
tag: ${{ github.ref }}
overwrite: true