minecraft-pi-reborn/scripts/package.sh
TheBrokenRail 97b46ad01a
All checks were successful
Build / Build (AMD64, Client) (push) Successful in 34m25s
Build / Build (AMD64, Server) (push) Successful in 26m21s
Build / Build (ARM64, Client) (push) Successful in 31m46s
Build / Build (ARM64, Server) (push) Successful in 30m1s
Build / Build (ARMHF, Client) (push) Successful in 30m7s
Build / Build (ARMHF, Server) (push) Successful in 26m36s
Build / Release (push) Successful in 5m26s
Build / Test (push) Successful in 43m14s
Fix AppImage updating, which has apparently been broken for *years*. Why didn't anyone tell me????
2023-11-25 18:22:43 -05:00

43 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
set -e
# Prepare
NAME='minecraft-pi-reborn'
MODE="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
ARCH="$(echo "$2" | tr '[:upper:]' '[:lower:]')"
# Build
./scripts/setup.sh "${MODE}" "${ARCH}" -DMCPI_IS_APPIMAGE_BUILD=ON
./scripts/build.sh "${MODE}" "${ARCH}"
# Download Runtime
mkdir -p build/appimage
if [ ! -f "build/appimage/runtime-${ARCH}" ]; then
case "${ARCH}" in
'armhf') RUNTIME_ARCH='armhf';;
'arm64') RUNTIME_ARCH='aarch64';;
'i386') RUNTIME_ARCH='i686';;
'amd64') RUNTIME_ARCH='x86_64';;
esac
wget -O "build/appimage/runtime-${ARCH}" "https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-${RUNTIME_ARCH}"
fi
# Package
case "${ARCH}" in
'armhf') APPIMAGE_ARCH='arm';;
'arm64') APPIMAGE_ARCH='arm_aarch64';;
'i386') APPIMAGE_ARCH='i686';;
'amd64') APPIMAGE_ARCH='x86_64';;
esac
ARCH="${APPIMAGE_ARCH}" appimagetool \
--updateinformation "zsync|https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/releases/download/latest/${NAME}-${MODE}-latest-${ARCH}.AppImage.zsync" \
--runtime-file "build/appimage/runtime-${ARCH}" \
--comp xz \
"./out/${MODE}-${ARCH}" \
"./out/${NAME}-${MODE}-$(cat VERSION)-${ARCH}.AppImage"
# Move ZSync
rm -f "./out/${NAME}-${MODE}-latest-${ARCH}.AppImage.zsync"
mv "./${NAME}-${MODE}-$(cat VERSION)-${ARCH}.AppImage.zsync" "./out/${NAME}-${MODE}-latest-${ARCH}.AppImage.zsync"