Skip to content

Commit

Permalink
Build appimages on CentOS7
Browse files Browse the repository at this point in the history
  • Loading branch information
timfel committed Aug 3, 2023
1 parent fb2638b commit 6187be2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:
matrix:
game: [{id: wargus, name: Wargus}, {id: war1gus, name: War1gus}]
name: Linux x64_64 (Continuous)
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
container: centos:7

steps:
- uses: actions/checkout@v2
- name: Build game ${{ matrix.game.id }}
Expand Down
19 changes: 16 additions & 3 deletions tools/build_appimage.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -ex

# Tested with
# appimagecrafters/appimage-builder
# and
Expand Down Expand Up @@ -31,12 +33,12 @@ if [ -z "$GAME_VERSION" ]; then
fi
export GAME_ARCH=$(uname -m)

CENTOS=`which yum || true`
CENTOS=`cat /etc/centos-release || true`
if [ -n "$CENTOS" ]; then
# centos (>= 7) build tools
yum install -yy centos-release-scl && yum install -yy git devtoolset-7-toolchain
yum install -yy zlib-devel file
scl enable devtoolset-7 bash
source /opt/rh/devtoolset-7/enable
# centos SDL dependencies
yum install -yy libX11-devel libXext-devel libXrandr-devel libXi-devel libXfixes-devel libXcursor-devel
yum install -yy pulseaudio-libs-devel
Expand Down Expand Up @@ -65,7 +67,14 @@ if [ -n "$CENTOS" ]; then
popd
fi

# git clone --depth 1 https://github.com/Wargus/stratagus
if [ -n "$CENTOS" ]; then
if [ -n "$GITHUB_REF" ]; then
git clone https://github.com/Wargus/stratagus
pushd stratagus
git fetch origin "${GITHUB_REF}"
git checkout FETCH_HEAD
fi
fi
git clone --depth 1 https://github.com/Wargus/${GAME_ID}

# pushd stratagus
Expand Down Expand Up @@ -114,6 +123,10 @@ if [ -n "$CENTOS" ]; then
chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir AppDir --output appimage
rm -f ./linuxdeploy-x86_64.AppImage
if [ -n "$GITHUB_REF" ]; then
cp *.AppImage "../${GAME_ID}-x86_64.AppImage"
popd
fi
else
# using appimage-builder
echo "version: 1" > appimagebuilder.yaml
Expand Down

0 comments on commit 6187be2

Please sign in to comment.