Files
UltimMC_Launcher/.github/workflows/main.yml
2021-11-11 16:20:12 -05:00

278 lines
10 KiB
YAML

name: CI
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_dispatch:
jobs:
build-linux:
name: build-linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
with:
submodules: 'recursive'
- name: Install Dependencies
run: |
sudo apt update
sudo apt install openjdk-8-jdk libgl1-mesa-dev qt5-default
- name: Build
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DLauncher_NOTIFICATION_URL:STRING=https://files.multimc.org/notifications.json \
-DCMAKE_INSTALL_PREFIX:PATH=/home/runner/UltimMC/UltimMC \
-DLauncher_UPDATER_BASE=https://files.multimc.org/update/ \
-DLauncher_PASTE_EE_API_KEY:STRING=utLvciUouSURFzfjPxLBf5W4ISsUX4pwBDF7N1AfZ \
-DLauncher_ANALYTICS_ID:STRING=UA-87731965-2 \
-DLauncher_LAYOUT=lin-nodeps \
-DLauncher_VERSION_BUILD=$(curl https://teamcity.multimc.org/guestAuth/app/rest/buildTypes/MultiMC_Launcher_Linux64_Build/builds/status:success/number) \
-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/UltimMC/UltimMC"
- name: Install
run: |
cd build
make install
chmod +x /home/runner/UltimMC/UltimMC/UltimMC
chmod +x /home/runner/UltimMC/UltimMC/bin/UltimMC
- name: Upload Artifacts
uses: actions/upload-artifact@v2.2.4
with:
name: mmc-cracked-lin64
path: /home/runner/UltimMC
build-windows:
name: build-windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2.4.0
with:
submodules: 'recursive'
- name: Cache Qt
uses: actions/cache@v2.1.6
id: qt-cached
with:
path: "D:/Qt"
key: ${{ runner.os }}-qt56-installed-d
- name: Cache Qt Installer
uses: actions/cache@v2.1.6
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://rickroll.is-inside.me/nPqUqs16.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.21.4/cmake-3.21.4-windows-i386.zip -o cmake.zip
unzip cmake.zip
- name: Setup JDK
uses: actions/setup-java@v2
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: |
for /F "tokens=*" %%n IN ('curl https://teamcity.multimc.org/guestAuth/app/rest/buildTypes/MultiMC_Launcher_Windows_Build/builds/status:success/number') DO @(set BUILD_NUM=%%n)
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=C:\hostedtoolcache\windows\Java_Zulu_jdk\8.0.292-10\x86\bin;%PATH%
set PATH=%CD%\cmake-3.21.4-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
cd build
cmake ^
-DCMAKE_BUILD_TYPE=Release ^
-DLauncher_NOTIFICATION_URL:STRING=https://files.multimc.org/notifications.json ^
-DCMAKE_INSTALL_PREFIX:PATH="D:/UltimMC/UltimMC" ^
-DLauncher_UPDATER_BASE=https://files.multimc.org/update/ ^
-DLauncher_PASTE_EE_API_KEY:STRING=utLvciUouSURFzfjPxLBf5W4ISsUX4pwBDF7N1AfZ ^
-DLauncher_ANALYTICS_ID:STRING=UA-87731965-2 ^
-DLauncher_LAYOUT=win-bundle ^
-DLauncher_VERSION_BUILD=%BUILD_NUM% ^
-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=C:\hostedtoolcache\windows\Java_Zulu_jdk\8.0.292-10\x86\bin;%PATH%
set PATH=%CD%\cmake-3.21.4-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=C:\hostedtoolcache\windows\Java_Zulu_jdk\8.0.292-10\x86\bin;%PATH%
set PATH=%CD%\cmake-3.21.4-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:/UltimMC/UltimMC"
- 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=C:\hostedtoolcache\windows\Java_Zulu_jdk\8.0.292-10\x86\bin;%PATH%
set PATH=%CD%\cmake-3.21.4-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:/UltimMC/UltimMC/ssleay32.dll
cp OpenSSL/libeay32.dll D:/UltimMC/UltimMC/libeay32.dll
- name: Upload Artifacts
uses: actions/upload-artifact@v2.2.4
with:
name: mmc-cracked-win32
path: "D:/UltimMC"
build-mac:
name: build-mac
runs-on: macos-latest
steps:
- uses: actions/checkout@v2.4.0
with:
submodules: 'recursive'
- name: Cache Dependencies
uses: actions/cache@v2.1.6
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/UltimMC/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_UPDATER_BASE=https://files.multimc.org/update/ \
-DLauncher_PASTE_EE_API_KEY:STRING=utLvciUouSURFzfjPxLBf5W4ISsUX4pwBDF7N1AfZ \
-DLauncher_ANALYTICS_ID:STRING=UA-87731965-2 \
-DLauncher_LAYOUT=mac-bundle \
-DLauncher_VERSION_BUILD=$(curl https://teamcity.multimc.org/guestAuth/app/rest/buildTypes/MultiMC_Launcher_MacOSAmd645152_Build/builds/status:success/number) \
-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/UltimMC/build/dist"
- name: Install
run: |
cd build
make install
chmod +x /Users/runner/work/UltimMC/build/dist/UltimMC.app/Contents/MacOS/UltimMC
- name: Upload Artifacts
uses: actions/upload-artifact@v2.2.4
with:
name: mmc-cracked-osx64
path: /Users/runner/work/UltimMC/build/dist