Create and release AppBundle #51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create and release AppBundle | |
concurrency: | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
schedule: | |
- cron: "0 0 1/14 * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: "Build Quake3e and prepare AppBundles" | |
runs-on: ubuntu-latest | |
container: | |
image: alpine:latest | |
options: "--privileged" | |
outputs: | |
release_tag: ${{ steps.set_tag.outputs.tag }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
apk add --no-cache sdl2-dev mesa-dev git \ | |
libxrandr-dev alsa-lib \ | |
curl curl-dev \ | |
build-base | |
- name: Clone & Build Quake3e | |
run: | | |
cd "$GITHUB_WORKSPACE" | |
git clone --depth=1 https://github.com/ec-/Quake3e | |
cd Quake3e | |
export CFLAGS="-O2 -static" | |
make -j$(nproc) -l$(nproc) \ | |
USE_CURL_DLOPEN=0 USE_RENDERER_DLOPEN=0 \ | |
USE_CODEC_VORBIS=1 USE_VOIP=1 \ | |
USE_CODEC_OPUS=1 USE_OPENAL=1 \ | |
USE_MUMBLE=1 USE_FREETYPE=1 \ | |
USE_OPENGL=1 USE_OPENGL2=1 \ | |
USE_VULKAN=1 RENDERER_DEFAULT=vulkan \ | |
USE_CURL=1 \ | |
SDL_VIDEODRIVER=wayland \ | |
DEFAULT_BASEDIR="." | |
echo "DATE=$(date +%d_%m_%Y)" >> $GITHUB_ENV | |
- name: Set release tag | |
id: set_tag | |
run: | | |
DATE="$(date +%d%m%Y)" | |
echo "tag=q3e-release-${DATE}" >> $GITHUB_OUTPUT | |
- name: Engine Only | |
run: | | |
cd "$GITHUB_WORKSPACE" | |
NAME="quake3e" | |
MAINTAINER="xplshn" | |
APPBUNDLE_ID="${NAME}-${{ env.DATE }}-${MAINTAINER}" | |
echo "APPBUNDLE_ID=$APPBUNDLE_ID" >> $GITHUB_ENV | |
mkdir -p "${APPBUNDLE_ID}.AppDir/usr/share" | |
wget -qO ./sharun "https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-$(uname -m)-aio" | |
chmod +x ./sharun | |
./sharun l --dst-dir "${APPBUNDLE_ID}.AppDir" -g -w -s ./Quake3e/build/release-linux-$(uname -m)/quake3e.* | |
echo '#!/bin/sh' > "${APPBUNDLE_ID}.AppDir/AppRun" | |
echo 'APPDIR="$(dirname "$(readlink -f "$0")")"' >> "${APPBUNDLE_ID}.AppDir/AppRun" | |
echo '"$APPDIR/bin/quake3e.x64" +set g_motd "check out https://github.com/pkgforge-dev/openArena" $@' >> "${APPBUNDLE_ID}.AppDir/AppRun" | |
chmod +x "${APPBUNDLE_ID}.AppDir/AppRun" | |
cp ./io.github.ec_.Quake3e.png "${APPBUNDLE_ID}.AppDir/.DirIcon" | |
cp ./io.github.ec_.Quake3e.appdata.xml \ | |
./io.github.ec_.Quake3e.desktop \ | |
"${APPBUNDLE_ID}.AppDir" | |
wget -qO ./pelf "https://github.com/xplshn/pelf/releases/latest/download/pelf_$(uname -m)" | |
chmod +x ./pelf | |
./pelf --add-appdir "${APPBUNDLE_ID}.AppDir" \ | |
--output-to "${NAME}.dwfs.AppBundle" \ | |
--appbundle-id "${APPBUNDLE_ID}" \ | |
--run-behavior 3 | |
- name: OpenArena + Engine | |
run: | | |
cd "$GITHUB_WORKSPACE" | |
NAME="openarena-quake3e" | |
MAINTAINER="xplshn" | |
APPBUNDLE_ID="${NAME}-${{ env.DATE }}-${MAINTAINER}" | |
mv "${{ env.APPBUNDLE_ID }}.AppDir" "${APPBUNDLE_ID}.AppDir" | |
mkdir -p /tmp/oazip "${APPBUNDLE_ID}.AppDir/usr/share/" | |
wget -qO- "https://downloads.sourceforge.net/project/oarena/openarena-0.8.8.zip" | unzip /dev/stdin -d /tmp/oazip | |
wget -qO- "https://files.poulsander.com/~poul19/public_files/oa/dev088/gamecode_nightly/openarena_gamecode_2024-06-23_025d283.zip" | unzip /dev/stdin -d /tmp/oazip | |
mv /tmp/oazip/openarena-0.8.8/missionpack \ | |
/tmp/oazip/openarena-0.8.8/baseoa \ | |
/tmp/oazip/oax \ | |
"${APPBUNDLE_ID}.AppDir/" | |
echo '#!/bin/sh' > "${APPBUNDLE_ID}.AppDir/AppRun" | |
echo 'APPDIR="${APPDIR:-$(dirname "$(readlink -f "$0")")}"' >> "${APPBUNDLE_ID}.AppDir/AppRun" | |
echo 'OA_CVARS="${OA_CVARS:=+set fs_game oax +set fs_basegame baseoa +set protocol 71 +set con_title OpenArena +set cl_title OpenArena}"' >> "${APPBUNDLE_ID}.AppDir/AppRun" | |
echo '"$APPDIR/bin/quake3e.x64" +set g_motd "check out https://github.com/pkgforge-dev/openArena" ${OA_CVARS} $@' >> "${APPBUNDLE_ID}.AppDir/AppRun" | |
chmod +x "${APPBUNDLE_ID}.AppDir/AppRun" | |
rm ${APPBUNDLE_ID}.AppDir/io.github.ec_.Quake3e* | |
cp ./io.github.ec_.Quake3e.OpenArena.png "${APPBUNDLE_ID}.AppDir/.DirIcon" | |
cp ./io.github.ec_.Quake3e.OpenArena.appdata.xml \ | |
./io.github.ec_.Quake3e.OpenArena.desktop \ | |
"${APPBUNDLE_ID}.AppDir" | |
./pelf --add-appdir "${APPBUNDLE_ID}.AppDir" \ | |
--output-to "${NAME}.dwfs.AppBundle" \ | |
--appbundle-id "${APPBUNDLE_ID}" \ | |
--run-behavior 2 | |
- name: List AppBundles | |
run: ls -lh *.AppBundle | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: appbundles | |
path: "*.AppBundle" | |
retention-days: 1 | |
release: | |
name: "Create GitHub Release" | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: appbundles | |
- name: Create Release | |
uses: softprops/[email protected] | |
with: | |
name: "Build ${{ needs.build.outputs.release_tag || github.run_number }}" | |
tag_name: "${{ needs.build.outputs.release_tag || github.run_number }}" | |
prerelease: false | |
draft: false | |
generate_release_notes: false | |
make_latest: true | |
files: | | |
*.AppBundle |