-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
290 lines (252 loc) · 10.2 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
281
282
283
284
285
286
287
288
289
290
name: CI
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_dispatch:
jobs:
build-linux:
name: build-linux
runs-on: ubuntu-18.04
steps:
- uses: actions/[email protected]
with:
submodules: 'recursive'
- name: Install Dependencies
run: |
sudo apt update
sudo apt install libgl1-mesa-dev qttools5-dev g++-5 gcc-5
- name: Build
run: |
mkdir build
cd build
cmake \
-DCMAKE_C_COMPILER=/usr/bin/gcc-5 \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-5 \
-DCMAKE_BUILD_TYPE=Release \
-DLauncher_NOTIFICATION_URL:STRING=https://files.multimc.org/notifications.json \
-DCMAKE_INSTALL_PREFIX:PATH=/home/runner/MCLauncher/MCLauncher \
-DLauncher_PASTE_EE_API_KEY:STRING=ajtc1fWcjZqLl0jWJ9orxvAs0em2VyeTYr8eX2NrA \
-DLauncher_IMGUR_CLIENT_ID:STRING=d7340b1158a28c6 \
-DLauncher_ANALYTICS_ID:STRING=G-JNJEESP8JE \
-DLauncher_LAYOUT=lin-nodeps \
-DLauncher_BUILD_PLATFORM=lin64 \
$GITHUB_WORKSPACE
- name: Compile
run: |
cd build
make tcversion
make -j$(nproc)
- name: Test
run: |
cd build
make test
cmake -E remove_directory "/home/runner/MCLauncher/MCLauncher"
- name: Install
run: |
cd build
make install
chmod +x /home/runner/MCLauncher/MCLauncher/MCLauncher
chmod +x /home/runner/MCLauncher/MCLauncher/bin//MCLauncher
- name: Upload Artifacts
uses: actions/[email protected]
with:
name: mmc-cracked-lin64
path: /home/runner/MCLauncher
build-windows:
name: build-windows
runs-on: windows-latest
steps:
- uses: actions/[email protected]
with:
submodules: 'recursive'
- name: Cache Qt
uses: actions/[email protected]
id: qt-cached
with:
path: "D:/Qt"
key: ${{ runner.os }}-qt56-installed-d
- name: Cache Qt Installer
uses: actions/[email protected]
if: steps.qt-cached.outputs.cache-hit != 'true'
id: installer-cached
with:
path: "installer.exe"
key: ${{ runner.os }}-qt56-installer
- name: Create QtAccount File
if: steps.qt-cached.outputs.cache-hit != 'true'
run: |
mkdir C:/Users/runneradmin/AppData/Roaming/Qt/
curl https://gist.github.com/Sebastian-byte/1086e0a3126be6a66580b71afcf8bd99/raw/797d8b90edf07ce88f265b38a573cc6b1fb45bfb/qtaccount.txt --output C:/Users/runneradmin/AppData/Roaming/Qt/qtaccount.ini
- name: Download Qt Installer
if: steps.installer-cached.outputs.cache-hit != 'true' && steps.qt-cached.outputs.cache-hit != 'true'
run: curl https://download.qt.io/new_archive/qt/5.6/5.6.3/qt-opensource-windows-x86-mingw492-5.6.3.exe --output installer.exe
- name: Download Qt non-Interactive Script
if: steps.qt-cached.outputs.cache-hit != 'true'
run: curl https://gist.githubusercontent.com/PibePlayer/cf6bd0a9f7e4d51e3e618ceedfba4b94/raw/09cb1415952b914f1567ce935d4618c396aec340/qt-installer-noninteractive.qs --output nonInteractive.qs
- name: Install Qt
if: steps.qt-cached.outputs.cache-hit != 'true'
shell: cmd
run: installer.exe -v --script nonInteractive.qs --silent
- name: Setup CMake
run: |
curl -L https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-windows-i386.zip -o cmake.zip
unzip cmake.zip
- name: Setup JDK
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: '8'
architecture: x86
- name: Setup zlib
run: |
mkdir zlib
cd zlib
curl -L https://downloads.sourceforge.net/project/gnuwin32/zlib/1.2.3/zlib-1.2.3-bin.zip -o zlib.zip
curl -L https://downloads.sourceforge.net/project/gnuwin32/zlib/1.2.3/zlib-1.2.3-lib.zip -o zliblibs.zip
unzip zlib.zip
unzip zliblibs.zip
- name: Setup OpenSSL
run: |
mkdir OpenSSL
cd OpenSSL
curl -L https://github.com/IndySockets/OpenSSL-Binaries/raw/master/Archive/openssl-1.0.2n-i386-win32.zip -o OpenSSL.zip
unzip OpenSSL.zip
- name: Build
shell: cmd
if: steps.build-cached.outputs.cache-hit != 'true'
run: |
set PATH=D:\Qt\5.6.3\mingw49_32\bin;D:\Qt\Tools\mingw492_32\bin;
set PATH=%CD%\zlib;%CD%\zlib\bin;%CD%\zlib\lib;%CD%\zlib\include;%PATH%
set PATH=%CD%\OpenSSL;%PATH%
set PATH=%CD%\cmake-3.22.1-windows-i386\bin;%PATH%
set CC=D:\Qt\Tools\mingw492_32\bin\gcc.exe
set CXX=D:\Qt\Tools\mingw492_32\bin\g++.exe
mkdir build
dir
cd build
cmake ^
-DCMAKE_BUILD_TYPE=Release ^
-DLauncher_NOTIFICATION_URL:STRING=https://files.multimc.org/notifications.json ^
-DCMAKE_INSTALL_PREFIX:PATH=D:/MCLauncher/install ^
-DLauncher_UPDATER_BASE=https://mmc.mcpeau.com/ ^
-DLauncher_VERSION_BUILD=%GITHUB_RUN_NUMBER% ^
-DLauncher_PASTE_EE_API_KEY:STRING=ajtc1fWcjZqLl0jWJ9orxvAs0em2VyeTYr8eX2NrA ^
-DLauncher_IMGUR_CLIENT_ID:STRING=d7340b1158a28c6 ^
-DLauncher_ANALYTICS_ID:STRING=G-JNJEESP8JE ^
-DLauncher_BUILD_PLATFORM=win32 ^
-G "MinGW Makefiles" ^
..
- name: Compile
shell: cmd
run: |
set PATH=D:\Qt\5.6.3\mingw49_32\bin;D:\Qt\Tools\mingw492_32\bin;
set PATH=%CD%\zlib;%CD%\zlib\bin;%PATH%
set PATH=%CD%\OpenSSL;%PATH%
set PATH=%CD%\cmake-3.22.1-windows-i386\bin;%PATH%
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;%PATH%
cd build
mingw32-make tcversion
mingw32-make -j%NUMBER_OF_PROCESSORS%
- name: Test
shell: cmd
run: |
set PATH=D:\Qt\5.6.3\mingw49_32\bin;D:\Qt\Tools\mingw492_32\bin;
set PATH=%CD%\zlib;%CD%\zlib\bin;%PATH%
set PATH=%CD%\OpenSSL;%PATH%
set PATH=%CD%\cmake-3.22.1-windows-i386\bin;%PATH%
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;%PATH%
cd build
mingw32-make test
cmake -E remove_directory "D:/MCLauncher/install"
- name: Install
shell: cmd
run: |
set PATH=D:\Qt\5.6.3\mingw49_32\bin;D:\Qt\Tools\mingw492_32\bin;
set PATH=%CD%\zlib;%CD%\zlib\bin;%PATH%
set PATH=%CD%\OpenSSL;%PATH%
set PATH=%CD%\cmake-3.22.1-windows-i386\bin;%PATH%
set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;%PATH%
cd build
mingw32-make install
- name: Copy OpenSSL
shell: cmd
run: |
cp OpenSSL/ssleay32.dll D:/MCLauncher/install/ssleay32.dll
cp OpenSSL/libeay32.dll D:/MCLauncher/install/libeay32.dll
- name: 生成json文件
run: |
cd D:/MCLauncher/
mkdir D:/MCLauncher/qiniu/win32/bs
mkdir D:/MCLauncher/qiniu/MCLauncher
curl -L https://mmc.mcpeau.com/mc.exe -o mc.exe
Compress-Archive -Path D:/MCLauncher/install/* -DestinationPath D:/MCLauncher/qiniu/MCLauncher.zip
.\mc $env:GITHUB_RUN_NUMBER
- name: Upload qiniu
run: |
cd D:/MCLauncher/
curl -L https://devtools.qiniu.com/qshell-v2.6.2-windows-386.zip -o qshell.zip
unzip qshell.zip
.\qshell account ${{ secrets.AK }} ${{ secrets.SK }} bs
.\qshell qupload2 --src-dir=./qiniu --bucket=${{ secrets.QINIU_Name }} --up-host=http://upload-z2.qiniu.com --overwrite=true --rescan-local=true
- name: Upload Artifacts
uses: actions/[email protected]
with:
name: mmc-cracked-win32
path: "D:/MCLauncher/install"
build-mac:
name: build-mac
runs-on: macos-latest
steps:
- uses: actions/[email protected]
with:
submodules: 'recursive'
- name: Cache Dependencies
uses: actions/[email protected]
with:
path: /Users/runner/Library/Caches/Homebrew
key: ${{ runner.os }}-deps-cache
- name: Install Dependencies
run: |
brew cleanup
brew install qt@5
- name: Build
run: |
mkdir build
cd build
cmake \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_BUILD_TYPE=Release \
-DLauncher_NOTIFICATION_URL:STRING=https://files.multimc.org/notifications.json \
-DCMAKE_INSTALL_PREFIX:PATH=/Users/runner/work/MCLauncher/build/dist \
-DCMAKE_PREFIX_PATH="$(brew --prefix qt@5);$(brew --prefix qt@5)/lib/cmake/Qt5Core;$(brew --prefix qt@5)/lib/cmake/Qt5Widgets;$(brew --prefix qt@5)/lib/cmake/Qt5Concurrent;$(brew --prefix qt@5)/lib/cmake/Qt5Network;$(brew --prefix qt@5)/lib/cmake/Qt5Test;$(brew --prefix qt@5)/lib/cmake/Qt5Xml" \
-DQt5_DIR="$(brew --prefix qt@5)" \
-DLauncher_PASTE_EE_API_KEY:STRING=ajtc1fWcjZqLl0jWJ9orxvAs0em2VyeTYr8eX2NrA \
-DLauncher_IMGUR_CLIENT_ID:STRING=d7340b1158a28c6 \
-DLauncher_ANALYTICS_ID:STRING=G-JNJEESP8JE \
-DLauncher_BUILD_PLATFORM=osx64-5.15.2 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
$GITHUB_WORKSPACE
- name: Compile
run: |
cd build
make tcversion
make -j$(sysctl -n hw.logicalcpu)
- name: Test
run: |
cd build
make test
cmake -E remove_directory "/Users/runner/work/MCLauncher/build/dist"
- name: Install
run: |
ls
cd build
make install
chmod +x /Users/runner/work/MCLauncher/build/dist/MCLauncher.app/Contents/MacOS/MCLauncher
- name: Upload Artifacts
uses: actions/[email protected]
with:
name: mmc-cracked-osx64
path: /Users/runner/work/MCLauncher/build/dist