Skip to content

Commit

Permalink
ci: use strategy matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Dec 29, 2024
1 parent 91feda3 commit 2273a71
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on: [push, pull_request]
jobs:
Linux:
runs-on: ubuntu-20.04
strategy:
matrix:
cmake_args: [-DDISCORD_RPC=ON -DDRAG_DROP=ON -DNETPLAY=ON -DVRU=ON -DUSE_ANGRYLION=ON, -DDISCORD_RPC=OFF -DDRAG_DROP=OFF -DNETPLAY=OFF -DVRU=OFF -DUSE_ANGRYLION=OFF]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -19,14 +22,22 @@ jobs:
- name: Prepare Environment
run: |
echo "GIT_REVISION=$(git describe --tags --always)" >> $GITHUB_ENV
- name: Build RMG (AppImage)
- name: Build RMG (AppImage) (${{ matrix.cmake_args }})
run: |
mkdir Build Build/AppImage Bin/ -p
export src_dir="$(pwd)"
export build_dir="$(pwd)/Build/AppImage"
export bin_dir="$(pwd)/Bin/AppImage"
if [ "${{ matrix.cmake_args }}" == "-DDISCORD_RPC=ON -DDRAG_DROP=ON -DNETPLAY=ON -DVRU=ON -DUSE_ANGRYLION=ON" ]
then
export build_dir="$(pwd)/Build/AppImage"
export bin_dir="$(pwd)/Bin/AppImage"
else
export build_dir="$(pwd)/Build/$RANDOM"
export bin_dir="$(pwd)/Bin/$RANDOM"
fi
mkdir $build_dir Bin/ -p
cmake -S "$src_dir" -B "$build_dir" -DCMAKE_BUILD_TYPE="Release" \
-DUSE_ANGRYLION=ON \
${{ matrix.cmake_args }} \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_INSTALL_LIBDIR="lib" \
-DPORTABLE_INSTALL="OFF" \
Expand All @@ -36,10 +47,12 @@ jobs:
cmake --install "$build_dir" --strip --prefix="$bin_dir/usr"
shell: bash
- name: Create AppImage
if: ${{ matrix.cmake_args == '-DDISCORD_RPC=ON -DDRAG_DROP=ON -DNETPLAY=ON -DVRU=ON -DUSE_ANGRYLION=ON' }}
run: |
./Package/AppImage/Create.sh
shell: bash
- name: Upload RMG (AppImage)
if: ${{ matrix.cmake_args == '-DDISCORD_RPC=ON -DDRAG_DROP=ON -DNETPLAY=ON -DVRU=ON -DUSE_ANGRYLION=ON' }}
uses: actions/upload-artifact@v4
with:
name: RMG-Portable-Linux64-${{ env.GIT_REVISION }}
Expand Down

0 comments on commit 2273a71

Please sign in to comment.