Bring back CI changes and macOS support

This commit is contained in:
oldmud0 2020-05-22 19:35:49 -05:00
parent fd1855b8d0
commit df8f19320b
11 changed files with 104 additions and 30 deletions

8
.github/labeler.yml vendored Normal file
View File

@ -0,0 +1,8 @@
translation:
- resource/translations/*
content:
- base/**/*
good_luck:
- src/courtroom.cpp

4
.gitignore vendored
View File

@ -4,6 +4,7 @@
*.dll
*.so
*.pro.autosave
*.pro.user
base_override.h
.DS_Store
@ -21,6 +22,7 @@ debug/
Makefile*
object_script*
/android/gradle*
/Attorney_Online_remake_resource.rc
/attorney_online_remake_plugin_import.cpp
@ -31,3 +33,5 @@ discord/
moc*
/Attorney_Online_CC_resource.rc
/attorney_online_cc_plugin_import.cpp
*.autosave

View File

@ -8,6 +8,9 @@ cache:
paths:
- lib/
variables:
DEBIAN_FRONTEND: noninteractive
before_script:
- echo Current working directory is $(pwd)
@ -22,22 +25,24 @@ build linux x86_64:
- apt-get update
- >
apt-get install --no-install-recommends -y qt5-default qtmultimedia5-dev
clang make git sudo curl ca-certificates pkg-config upx unzip
clang make git sudo curl ca-certificates pkg-config upx unzip xz-utils
- git submodule init
- git submodule update
# Print versions
- qmake --version
- clang --version
# Extract BASS
- mkdir bass
- cd bass
- curl http://www.un4seen.com/files/bass24-linux.zip -o bass.zip
- unzip bass.zip
- cp x64/libbass.so ../lib
- curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus.zip
- unzip bassopus.zip
- cp x64/libbassopus.so ../lib
- cd ..
#- mkdir bass
#- cd bass
#- curl http://www.un4seen.com/files/bass24-linux.zip -o bass.zip
#- unzip bass.zip
#- cp x64/libbass.so ../lib
#- curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus.zip
#- unzip bassopus.zip
#- cp x64/libbassopus.so ../lib
#- cd ..
# Extract Discord RPC
- mkdir discord-rpc
@ -56,7 +61,7 @@ build linux x86_64:
- cd ..
# Build
- qmake -spec linux-clang
- qmake -spec linux-clang "DEFINES += DISCORD QTAUDIO"
- make -j4
# Post-processing
@ -75,6 +80,11 @@ build windows i686:
# Install dependencies
- apt-get update
- apt-get install --no-install-recommends -y make curl ca-certificates upx unzip
- git submodule init
- git submodule update
# Print versions
- /opt/mxe/usr/${TARGET_SPEC}/qt5/bin/qmake --version
# Extract BASS
- mkdir bass
@ -87,8 +97,19 @@ build windows i686:
- cp bassopus.dll ../lib
- cd ..
# Extract QtApng
# - mkdir qtapng
# - cd qtapng
# - curl -L https://github.com/Skycoder42/QtApng/releases/download/1.1.2-2/qtapng_mingw73_32_5.13.0.zip -o apng.zip
# - unzip apng.zip
# - mkdir ../lib/imageformats
# - cp mingw73_32/plugins/imageformats/qapng.dll ../lib/imageformats/
# - cd ..
- ls lib
# Build
- /opt/mxe/usr/${TARGET_SPEC}/qt5/bin/qmake
- /opt/mxe/usr/${TARGET_SPEC}/qt5/bin/qmake "DEFINES += DISCORD BASSAUDIO"
- make -j4
# Post-processing
@ -124,7 +145,7 @@ deploy linux x86_64:
- *deploy_misc
# Platform-specific
- cp -a ../lib/*.so .
- cp -a ../lib/* .
- cp -a ../bin/Attorney_Online .
- echo "#!/bin/sh" >> ./run.sh
- echo "LD_LIBRARY_PATH=.:\$LD_LIBRARY_PATH ./Attorney_Online" >> ./run.sh
@ -158,6 +179,8 @@ deploy windows i686:
# Platform-specific
- cp -a ../lib/*.dll .
- mkdir imageformats
- 'cp -a ../lib/imageformats/*.dll imageformats/ || :'
- cp -a ../bin/Attorney_Online.exe .
# Zipping
@ -190,11 +213,17 @@ publish linux x86_64:
- deploy linux x86_64
when: manual
script:
- apt-get update
- apt-get install --no-install-recommends -y git nodejs npm awscli
- cd scripts
- npm install
- cd ..
- cd zip
- ../scripts/wasabi.sh
- ../scripts/wasabi_program.sh
variables:
MANIFEST: program_linux_x86_64.json
ARTIFACT_SUFFIX: _linux_x64.tar.xz
ARTIFACT_SUFFIX: linux_x64.tar.xz
publish windows i686:
image: ubuntu
@ -203,8 +232,14 @@ publish windows i686:
- deploy windows i686
when: manual
script:
- apt-get update
- apt-get install --no-install-recommends -y git nodejs npm awscli
- cd scripts
- npm install
- cd ..
- cd zip
- ../scripts/wasabi.sh
- ../scripts/wasabi_program.sh
variables:
MANIFEST: program_winnt_i386.json
ARTIFACT_SUFFIX: _windows_x86.zip
ARTIFACT_SUFFIX: windows_x86.zip

View File

@ -1,11 +1,21 @@
language: cpp
os: osx
addons:
homebrew:
packages:
- qt5
homebrew:
update: true
packages:
- qt5
script:
- ./scripts/macos_build.sh
- ./scripts/macos_post_build.sh
- "./scripts/macos_build.sh"
- "./scripts/macos_post_build.sh"
deploy:
provider: releases
api_key:
secure: mZCNwnqKeqJP5CqgYOanYnr/KHydxueGPRhvGLpY0Pop7MiH3CIHMN5dhHbtgJvE5GGMR4xUIEhPpmkCEJw7YiPREMqT4mkV4DR531ZLB3t/FizyvIwXuP6jFwzTofZ51qHfBpcurVc9sMFeD9Pw+rLTTgIiXL2sZxUUXc8U+ZZug1lYndgcO6P00fUJd6V9lyFQUGmbSca97YbG6KuCym0fEpyRnMqzKLjYsUUo8UKRBADtmD822O6z2FSldNZDn45Mkx0MYfHWyT5hzTb7WGa+DrTB/0un1HqqsNPlb/ahjrFQQNR2qd7HNGZa+Mvwi6egTDug+k15x8lbkacUoi34U1eFq9LSTYm8dSO5g23I1OvGvjTCkDj1jOLPqB99XlbAJ0E/9Jzw7wtlLaAzvFzTj/B63TQnO3IsgHBWR14CZlf05WMOFf2irwl+kL6ktspIHnlGgaiWYYrKeAt7QJAXiQOdYDz6SaWVC6TyOE/SszXRU6xFotmCjkP2irM5yGE8SUw2uIzKjD9uG0ZXtbLcdQEFD316+qglqFTCjnKsRfbtQs2u5spZPsZSdsOZCbLfNIn0GSTFRymFsK6gsvji8AD8AZo0zcOZ/7NMVC6A8RnF3Ve+vU/xljhsIOxoLZDvZPia7WozdV99xmnepWBwkuoQs/K0xmWcnLZDcb0=
file: "../bin/Attorney_Online_mac_x86_64.zip"
draft: true
on:
tags: true
repo: AttorneyOnline/AO2-Client

View File

@ -7,11 +7,13 @@ set -eu
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
cd ${ROOT_DIR}
cd "${ROOT_DIR}"
#need some openGL stuff
sudo apt install libgl1-mesa-dev
#install curl incase of fresh vm
sudo apt install curl
mkdir tmp
cd tmp

View File

@ -30,4 +30,4 @@ tar -xvf apng.tar.xz
cp clang_64/plugins/imageformats/libqapng.dylib ../lib
cd ..
qmake && make -j2
/usr/local/opt/qt/bin/qmake && make -j2

4
scripts/macos_post_build.sh Normal file → Executable file
View File

@ -13,10 +13,12 @@ ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
cd ${ROOT_DIR}
# This thing basically does all the work
macdeployqt ../bin/Attorney_Online.app
/usr/local/opt/qt/bin/macdeployqt ../bin/Attorney_Online.app
# Need to add the dependencies
cp ../lib/* ../bin/Attorney_Online.app/Contents/Frameworks
# libbass has a funny path for some reason, just use rpath
install_name_tool -change @loader_path/libbass.dylib @rpath/libbass.dylib ../bin/Attorney_Online.app/Contents/MacOS/Attorney_Online
zip -r -9 ../bin/Attorney_Online_mac_x86_64.zip ../bin/

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Updates the specified program manifest to a new archive and version
# and uploads the new archive and manifest to S3/Wasabi.
#

View File

@ -10,5 +10,12 @@ RUN /opt/mxe/usr/bin/${TARGET_SPEC}-cmake .. -DCMAKE_INSTALL_PREFIX=/opt/mxe/usr
RUN /opt/mxe/usr/bin/${TARGET_SPEC}-cmake --build . --config Release --target install
WORKDIR ../..
# NOTE: Do not build QtApng statically! libpng contains a self-test entry point that
# takes precedence for some reason over the final build's entry point.
# Build QtApng statically
RUN git clone https://github.com/Skycoder42/QtApng
WORKDIR QtApng
# libpng contains a self-test entry point that takes precedence for some reason
# over the final build's entry point.
RUN sed -i "s/^main(/libpng_main(/g" src/3rdparty/libpng/src/pngtest.c
RUN /opt/mxe/usr/${TARGET_SPEC}/qt5/bin/qmake
RUN make && make install
WORKDIR ..

View File

@ -49,6 +49,10 @@ QString get_hdid()
}
#elif defined __APPLE__
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
QString get_hdid()
{
CFStringRef serial;

View File

@ -30,6 +30,8 @@ QString AOApplication::get_base_path()
QString external_storage = getenv("EXTERNAL_STORAGE");
base_path = external_storage + "/AO2/";
}
#elif defined(__APPLE__)
base_path = applicationDirPath() + "/../../../base/";
#else
base_path = applicationDirPath() + "/base/";
#endif