add github action to build appimage

This commit is contained in:
Tim Felgentreff 2023-01-14 09:18:29 +01:00
parent f82a0ecb69
commit c9003dd867
2 changed files with 61 additions and 18 deletions

42
.github/workflows/appimage.yml vendored Normal file
View file

@ -0,0 +1,42 @@
name: AppImage Continuous
on:
push:
branches:
- master
workflow_dispatch:
env:
BUILD_TYPE: RelWithDebInfo
jobs:
linux-appimage-continuous:
strategy:
matrix:
game: [{id: wargus, name: Wargus}, {id: war1gus, name: War1gus}]
name: Linux x64_64 (Continuous)
runs-on: ubuntu-18.04
steps:
- name: Build game ${{ matrix.game.id }}
run: bash -x ./tools/build_appimage.sh ${{ matrix.game.id }} ${{ matrix.game.name }}
- name: Build appimage
uses: AppImageCrafters/build-appimage@master
with:
recipe: "./appimagebuilder.yaml"
- name: Create continuous release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "*.AppImage*"
body: |
:heavy_check_mark: AppImage built from latest commit ([${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})).
:scroll: Build log: https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks?check_suite_id=${{ github.run_id }}
commit: ${{ github.sha }}
draft: false
name: Continuous appimage builds
prerelease: true
removeArtifacts: false
replacesArtifacts: true
skipIfReleaseExists: false
tag: continuous
token: "${{ secrets.GITHUB_TOKEN }}"

View file

@ -26,8 +26,7 @@ if [ -z "$GAME_VERSION" ]; then
if [ $# -gt 2 ]; then
export GAME_VERSION="$3"
else
echo "Need GAME_VERSION set or passed as third argument"
exit 1
export GAME_VERSION="$(head -1 debian/changelog | cut -f2 -d' ' | sed 's/(//' | sed 's/)//')"
fi
fi
export GAME_ARCH=$(uname -m)
@ -64,10 +63,10 @@ pushd cmake-3.*
make install
popd
git clone --depth 1 https://github.com/Wargus/stratagus
# git clone --depth 1 https://github.com/Wargus/stratagus
git clone --depth 1 https://github.com/Wargus/${GAME_ID}
pushd stratagus
# pushd stratagus
git submodule update --init --recursive
mkdir build
pushd build
@ -80,7 +79,7 @@ pushd stratagus
-DGAMEDIR=/usr/bin
make -j install DESTDIR=../../AppDir
popd
popd
# popd
pushd ${GAME_ID}
git submodule update --init --recursive
mkdir build
@ -114,17 +113,19 @@ if [ -n "$CENTOS" ]; then
./linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir AppDir --output appimage
else
# using appimage-builder
echo "version: 1" > appimagebuilder.yaml
echo "AppDir:" >> appimagebuilder.yaml
echo " path: ./AppDir" >> appimagebuilder.yaml
echo " app_info:" >> appimagebuilder.yaml
echo " id: com.stratagus.{{GAME_ID}}" >> appimagebuilder.yaml
echo " name: '{{GAME_NAME}}'" >> appimagebuilder.yaml
echo " icon: '{{GAME_ID}}'" >> appimagebuilder.yaml
echo " version: '{{GAME_VERSION}}'" >> appimagebuilder.yaml
echo " exec: usr/bin/{{GAME_ID}}" >> appimagebuilder.yaml
echo ' exec_args: --argv0=${APPDIR}/usr/bin/{{GAME_ID}} $@' >> appimagebuilder.yaml
echo "AppImage:" >> appimagebuilder.yaml
echo " arch: '{{GAME_ARCH}}'" >> appimagebuilder.yaml
appimage-builder --recipe appimagebuilder.yaml
echo "version: 1" > appimagebuilder.yaml
echo "AppDir:" >> appimagebuilder.yaml
echo " path: ./AppDir" >> appimagebuilder.yaml
echo " app_info:" >> appimagebuilder.yaml
echo " id: com.stratagus.${GAME_ID}" >> appimagebuilder.yaml
echo " name: '${GAME_NAME}'" >> appimagebuilder.yaml
echo " icon: '${GAME_ID}'" >> appimagebuilder.yaml
echo " version: '${GAME_VERSION}'" >> appimagebuilder.yaml
echo " exec: usr/bin/${GAME_ID}" >> appimagebuilder.yaml
echo -n ' exec_args: --argv0=${APPDIR}/usr/bin/' >> appimagebuilder.yaml
echo -n "${GAME_ID} " >> appimagebuilder.yaml
echo '$@' >> appimagebuilder.yaml
echo "AppImage:" >> appimagebuilder.yaml
echo " arch: '${GAME_ARCH}'" >> appimagebuilder.yaml
appimage-builder --recipe appimagebuilder.yaml || true # in github, we run this after
fi