220 lines
7.3 KiB
YAML
220 lines
7.3 KiB
YAML
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
|
|
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
|
|
name: CI Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master" ]
|
|
pull_request:
|
|
branches: [ "master" ]
|
|
|
|
|
|
jobs:
|
|
formatting-check:
|
|
name: formatting-check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Run clang-format style check for C++
|
|
uses: jidicula/clang-format-action@v4.12.0
|
|
with:
|
|
clang-format-version: '17'
|
|
check-path: 'src'
|
|
fallback-style: LLVM
|
|
|
|
|
|
|
|
build-windows:
|
|
needs: formatting-check
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v3
|
|
with:
|
|
version: 6.5.3
|
|
target: desktop
|
|
arch: win64_msvc2019_64
|
|
cache: true
|
|
cache-key-prefix: install-qt-action
|
|
|
|
- name: Clone QtApng
|
|
uses: actions/checkout@master
|
|
with:
|
|
repository: Skycoder42/QtApng
|
|
path: "QtApng"
|
|
|
|
- name: Configure MSVC (Windows)
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
- name: Build and deploy QtApng
|
|
run: |
|
|
cd QtApng/src/3rdparty
|
|
chmod +x get_libs.sh
|
|
./get_libs.sh 1.3.1 1.6.40
|
|
cd ../..
|
|
qmake CONFIG+=install_ok QMAKE_CXXFLAGS+="-fno-sized-deallocation"
|
|
nmake
|
|
cd ..
|
|
mkdir ./bin/imageformats
|
|
cp ./QtApng/plugins/imageformats/qapng.dll ./bin/imageformats/qapng.dll
|
|
|
|
- name: Install Windows Discord RPC
|
|
shell: bash
|
|
run: |
|
|
curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-win.zip -o discord_rpc.zip
|
|
unzip discord_rpc.zip
|
|
cp ./discord-rpc/win64-dynamic/lib/discord-rpc.lib ./lib/
|
|
cp ./discord-rpc/win64-dynamic/bin/discord-rpc.dll ./bin/
|
|
cp ./discord-rpc/win64-dynamic/include/discord*.h ./lib/
|
|
|
|
- name: Install Windows BASS
|
|
shell: bash
|
|
run: |
|
|
curl http://www.un4seen.com/files/bass24.zip -o bass.zip
|
|
unzip -d bass -o bass.zip
|
|
cp ./bass/c/bass.h ./lib
|
|
cp ./bass/c/x64/bass.lib ./lib/
|
|
cp ./bass/x64/bass.dll ./bin/
|
|
|
|
curl http://www.un4seen.com/files/bassmidi24.zip -o bassmidi.zip
|
|
unzip -d bass -o bassmidi.zip
|
|
cp ./bass/c/bassmidi.h ./lib
|
|
cp ./bass/c/x64/bassmidi.lib ./lib/
|
|
cp ./bass/x64/bassmidi.dll ./bin/
|
|
|
|
curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip
|
|
unzip -d bass -o bassopus.zip
|
|
cp ./bass/c/bassopus.h ./lib
|
|
cp ./bass/c/x64/bassopus.lib ./lib/
|
|
cp ./bass/x64/bassopus.dll ./bin/
|
|
|
|
- name: Set reusable strings
|
|
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
|
|
id: strings
|
|
shell: bash
|
|
run: |
|
|
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Configure CMake
|
|
run: >
|
|
cmake -B ${{ steps.strings.outputs.build-output-dir }}
|
|
-DCMAKE_CXX_COMPILER=cl
|
|
-DCMAKE_C_COMPILER=cl
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
-S ${{ github.workspace }}
|
|
|
|
- name: Build
|
|
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
|
|
|
|
- name: Deploy Windows
|
|
working-directory: ${{github.workspace}}/bin/
|
|
shell: bash
|
|
run: |
|
|
windeployqt --no-quick-import --no-translations --no-virtualkeyboard --no-compiler-runtime --no-webkit2 --no-opengl-sw ./Attorney_Online.exe
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@master
|
|
with:
|
|
name: Attorney_Online-Windows
|
|
path: ${{github.workspace}}/bin
|
|
|
|
build-linux:
|
|
needs: formatting-check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install Qt (Ubuntu)
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get upgrade
|
|
sudo apt-get install qtbase5-dev libqt5websockets5-dev qttools5-dev qt5-image-formats-plugins
|
|
|
|
- name: Clone QtApng
|
|
uses: actions/checkout@master
|
|
with:
|
|
repository: Skycoder42/QtApng
|
|
path: "QtApng"
|
|
|
|
- name: Build and deploy QtApng
|
|
run: |
|
|
cd QtApng/src/3rdparty
|
|
chmod +x get_libs.sh
|
|
./get_libs.sh 1.3.1 1.6.40
|
|
cd ../..
|
|
qmake CONFIG+=install_ok QMAKE_CXXFLAGS+="-fno-sized-deallocation"
|
|
make
|
|
|
|
- name: Install Linux Discord RPC
|
|
run: |
|
|
curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-linux.zip -o discord_rpc.zip
|
|
unzip discord_rpc.zip
|
|
cp ./discord-rpc/linux-dynamic/lib/libdiscord-rpc.so ./lib/
|
|
cp ./discord-rpc/linux-dynamic/lib/libdiscord-rpc.so ./bin/
|
|
cp ./discord-rpc/linux-dynamic/include/discord*.h ./src/
|
|
|
|
- name: Install Linux BASS
|
|
run: |
|
|
curl http://www.un4seen.com/files/bass24-linux.zip -o bass.zip
|
|
unzip -d bass -o bass.zip
|
|
cp ./bass/bass.h ./lib
|
|
cp ./bass/libs/x86_64/libbass.so ./lib/
|
|
cp ./bass/libs/x86_64/libbass.so ./bin/
|
|
|
|
curl http://www.un4seen.com/files/bassmidi24-linux.zip -o bassmidi.zip
|
|
unzip -d bass -o bassmidi.zip
|
|
cp ./bass/bassmidi.h ./lib
|
|
cp ./bass/libs/x86_64/libbassmidi.so ./lib/
|
|
cp ./bass/libs/x86_64/libbassmidi.so ./bin/
|
|
|
|
curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus.zip
|
|
unzip -d bass -o bassopus.zip
|
|
cp ./bass/bassopus.h ./lib
|
|
cp ./bass/libs/x86_64/libbassopus.so ./lib/
|
|
cp ./bass/libs/x86_64/libbassopus.so ./bin/
|
|
|
|
- name: Set reusable strings
|
|
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
|
|
id: strings
|
|
shell: bash
|
|
run: |
|
|
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Configure CMake
|
|
run: >
|
|
cmake -B ${{ steps.strings.outputs.build-output-dir }}
|
|
-DCMAKE_CXX_COMPILER=g++
|
|
-DCMAKE_C_COMPILER=gcc
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
-S ${{ github.workspace }}
|
|
|
|
- name: Build
|
|
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
|
|
|
|
- name: Deploy Linux
|
|
working-directory: ${{github.workspace}}/bin/
|
|
shell: bash
|
|
run: |
|
|
cp ../scripts/launch.sh .
|
|
mkdir -p imageformats
|
|
cp ../QtApng/plugins/imageformats/libqapng.so ./imageformats/libqapng.so
|
|
chmod +x launch.sh
|
|
chmod +x Attorney_Online
|
|
tar -cf Attorney_Online.tar ./*
|
|
rm -rf imageformats
|
|
rm *.so
|
|
rm *.sh
|
|
rm Attorney_Online
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@master
|
|
with:
|
|
name: Attorney_Online-Linux
|
|
path: ${{github.workspace}}/bin/Attorney_Online.tar
|