2022-05-19 08:51:26 +00:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
2022-07-05 12:45:36 +00:00
|
|
|
push:
|
2022-07-31 20:05:30 +00:00
|
|
|
branches:
|
2022-07-31 20:06:27 +00:00
|
|
|
- main
|
2022-07-05 12:45:36 +00:00
|
|
|
pull_request:
|
2022-07-31 20:05:30 +00:00
|
|
|
types:
|
|
|
|
- opened
|
|
|
|
- synchronize
|
2022-05-19 08:51:26 +00:00
|
|
|
|
|
|
|
defaults:
|
2022-07-05 12:45:36 +00:00
|
|
|
run:
|
|
|
|
shell: bash
|
2022-05-19 08:51:26 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-07-05 21:09:22 +00:00
|
|
|
static-analysis:
|
|
|
|
name: Static analysis
|
2022-05-19 08:51:26 +00:00
|
|
|
|
2022-07-05 12:45:36 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-05-19 08:51:26 +00:00
|
|
|
|
2022-07-05 21:09:22 +00:00
|
|
|
steps:
|
2022-07-05 12:45:36 +00:00
|
|
|
- name: Install
|
2022-07-05 21:09:22 +00:00
|
|
|
run: |
|
|
|
|
sudo apt update
|
2022-06-08 19:36:39 +00:00
|
|
|
sudo apt install cppcheck
|
2022-05-19 08:51:26 +00:00
|
|
|
|
2022-07-05 12:45:36 +00:00
|
|
|
- name: Clone
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: cppcheck
|
2022-07-05 21:09:22 +00:00
|
|
|
run: cppcheck --std=c++17 src/
|
|
|
|
|
2022-07-29 17:04:37 +00:00
|
|
|
android:
|
|
|
|
name: Android
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Clone
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup Java
|
|
|
|
uses: actions/setup-java@v2
|
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 11
|
|
|
|
cache: gradle
|
|
|
|
|
|
|
|
- name: Cache cmake build
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: os/android/app/.cxx
|
|
|
|
key: android-cmake-v1
|
|
|
|
|
|
|
|
- name: Setup signing config
|
2022-08-16 21:01:20 +00:00
|
|
|
if: env.KEYSTORE_FILE_BASE64 != '' && env.KEYSTORE_PROPERTIES_FILE_BASE64 != ''
|
2022-07-29 17:04:37 +00:00
|
|
|
run: |
|
|
|
|
cd os/android
|
|
|
|
echo "$KEYSTORE_FILE_BASE64" | base64 --decode > debug.keystore
|
|
|
|
echo "$KEYSTORE_PROPERTIES_FILE_BASE64" | base64 --decode > debug-keystore.properties
|
|
|
|
env:
|
|
|
|
KEYSTORE_FILE_BASE64: ${{ secrets.ANDROID_DEBUG_KEYSTORE_FILE_BASE64 }}
|
|
|
|
KEYSTORE_PROPERTIES_FILE_BASE64: ${{ secrets.ANDROID_DEBUG_KEYSTORE_PROPERTIES_FILE_BASE64 }}
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cd os/android
|
|
|
|
./gradlew assembleDebug
|
|
|
|
|
|
|
|
- name: Upload
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: fallout2-ce-debug.apk
|
|
|
|
path: os/android/app/build/outputs/apk/debug/app-debug.apk
|
|
|
|
retention-days: 7
|
|
|
|
|
2022-10-14 08:40:11 +00:00
|
|
|
ios:
|
|
|
|
name: iOS
|
|
|
|
|
|
|
|
runs-on: macos-11
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Clone
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Cache cmake build
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: build
|
|
|
|
key: ios-cmake-v1
|
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-D CMAKE_TOOLCHAIN_FILE=cmake/toolchain/ios.toolchain.cmake \
|
|
|
|
-D ENABLE_BITCODE=0 \
|
|
|
|
-D PLATFORM=OS64 \
|
|
|
|
# EOL
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
--build build \
|
|
|
|
-j $(sysctl -n hw.physicalcpu) \
|
|
|
|
--target package \
|
|
|
|
# EOL
|
|
|
|
|
|
|
|
# TODO: Should be a part of packaging.
|
|
|
|
- name: Prepare for uploading
|
|
|
|
run: |
|
|
|
|
cp build/fallout2-ce.zip build/fallout2-ce.ipa
|
|
|
|
|
|
|
|
- name: Upload
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: fallout2-ce.ipa
|
|
|
|
path: build/fallout2-ce.ipa
|
|
|
|
retention-days: 7
|
|
|
|
|
2022-07-05 21:09:22 +00:00
|
|
|
linux:
|
|
|
|
name: Linux (${{ matrix.arch }})
|
|
|
|
|
|
|
|
runs-on: ubuntu-20.04
|
2022-07-05 12:45:36 +00:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-07-05 21:09:22 +00:00
|
|
|
arch:
|
|
|
|
- x86
|
|
|
|
- x64
|
2022-07-05 12:45:36 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Clone
|
|
|
|
uses: actions/checkout@v3
|
2022-06-08 19:36:39 +00:00
|
|
|
|
2022-07-05 21:09:22 +00:00
|
|
|
- name: Dependencies (x86)
|
|
|
|
if: matrix.arch == 'x86'
|
|
|
|
run: |
|
|
|
|
sudo dpkg --add-architecture i386
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install --allow-downgrades libpcre2-8-0=10.34-7
|
|
|
|
sudo apt install g++-multilib libsdl2-dev:i386 zlib1g-dev:i386
|
|
|
|
|
|
|
|
- name: Dependencies (x64)
|
|
|
|
if: matrix.arch == 'x64'
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install libsdl2-dev zlib1g-dev
|
|
|
|
|
|
|
|
- name: Cache cmake build
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: build
|
|
|
|
key: linux-${{ matrix.arch }}-cmake-v1
|
|
|
|
|
|
|
|
- name: Configure (x86)
|
|
|
|
if: matrix.arch == 'x86'
|
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-D CMAKE_TOOLCHAIN_FILE=cmake/toolchain/Linux32.cmake \
|
|
|
|
# EOL
|
|
|
|
|
|
|
|
- name: Configure (x64)
|
|
|
|
if: matrix.arch == 'x64'
|
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
# EOL
|
2022-06-08 19:36:39 +00:00
|
|
|
|
2022-07-05 12:45:36 +00:00
|
|
|
- name: Build
|
2022-07-05 21:09:22 +00:00
|
|
|
run: |
|
2022-07-26 13:49:10 +00:00
|
|
|
cmake \
|
|
|
|
--build build \
|
|
|
|
-j $(nproc) \
|
|
|
|
# EOL
|
2022-07-05 21:09:22 +00:00
|
|
|
|
|
|
|
- name: Upload
|
2022-07-05 12:45:36 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2022-07-05 21:09:22 +00:00
|
|
|
name: fallout2-ce-linux-${{ matrix.arch }}
|
|
|
|
path: build/fallout2-ce
|
2022-07-05 12:45:36 +00:00
|
|
|
retention-days: 7
|
|
|
|
|
|
|
|
macos:
|
2022-07-05 21:09:22 +00:00
|
|
|
name: macOS
|
|
|
|
|
2022-07-06 08:25:10 +00:00
|
|
|
runs-on: macos-11
|
2022-07-05 12:45:36 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Clone
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2022-07-05 21:09:22 +00:00
|
|
|
- name: Cache cmake build
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: build
|
2022-07-25 21:58:02 +00:00
|
|
|
key: macos-cmake-v3
|
2022-07-05 21:09:22 +00:00
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
run: |
|
2022-07-26 13:49:10 +00:00
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
# EOL
|
2022-07-05 21:09:22 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2022-07-26 13:49:10 +00:00
|
|
|
cmake \
|
|
|
|
--build build \
|
|
|
|
-j $(sysctl -n hw.physicalcpu) \
|
|
|
|
--target package \
|
|
|
|
# EOL
|
2022-07-05 21:09:22 +00:00
|
|
|
|
|
|
|
- name: Upload
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: fallout2-ce-macos.dmg
|
2022-07-26 13:49:10 +00:00
|
|
|
path: build/fallout2-ce.dmg
|
2022-07-05 21:09:22 +00:00
|
|
|
retention-days: 7
|
|
|
|
|
|
|
|
windows:
|
|
|
|
name: Windows (${{ matrix.arch }})
|
|
|
|
|
|
|
|
runs-on: windows-2019
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- arch: x86
|
|
|
|
generator-platform: Win32
|
|
|
|
- arch: x64
|
|
|
|
generator-platform: x64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Clone
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Cache cmake build
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: build
|
|
|
|
key: windows-${{ matrix.arch }}-cmake-v1
|
|
|
|
|
2022-07-05 12:45:36 +00:00
|
|
|
- name: Configure
|
|
|
|
run: |
|
2022-07-05 21:09:22 +00:00
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Visual Studio 16 2019" \
|
|
|
|
-A ${{ matrix.generator-platform }} \
|
|
|
|
# EOL
|
2022-07-05 12:45:36 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2022-07-05 21:09:22 +00:00
|
|
|
cmake \
|
|
|
|
--build build \
|
|
|
|
--config RelWithDebInfo \
|
|
|
|
# EOL
|
2022-07-05 12:45:36 +00:00
|
|
|
|
|
|
|
- name: Upload
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2022-07-05 21:09:22 +00:00
|
|
|
name: fallout2-ce-windows-${{ matrix.arch }}
|
|
|
|
path: build/RelWithDebInfo/fallout2-ce.exe
|
2022-07-05 12:45:36 +00:00
|
|
|
retention-days: 7
|