Add DMG wrapping to CI

This commit is contained in:
DaCool
2022-06-09 15:55:45 +00:00
committed by Sheepit Renderfarm
parent 3c5b3aba99
commit a5cce0ecc6
10 changed files with 89 additions and 1 deletions

11
dmg-wrapper/SheepIt-Run.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail # Unofficial strict mode, see http://redsymbol.net/articles/unofficial-bash-strict-mode/
cd "$(dirname "$(readlink -f "$0")")"
# see https://stackoverflow.com/questions/3349105/how-can-i-set-the-current-working-directory-to-the-directory-of-the-script-in-ba
echo "Please only pin the first window - the launcher to the Dock"
echo "============================="
echo "Loading and launching SheepIt"
nohup "$BIN" -Xdock:icon=./$APP.png -Djna.nosys=true -jar "$JAR" &>/dev/null & disown
osascript -e 'tell application "Terminal" to close (every window whose name contains "SheepIt-Run.sh")' &
exit 0

BIN
dmg-wrapper/SheepIt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
dmg-wrapper/SheepIt.tar.gz Normal file

Binary file not shown.

View File

@@ -0,0 +1,11 @@
#!/bin/bash
sudo apt-get install git cmake build-essential zlib1g-dev
git clone https://github.com/fanquake/libdmg-hfsplus.git
cd libdmg-hfsplus
cmake . -B build
make -C build/dmg -j8
mv build/dmg/dmg ..
cd ..
rm -rf libdmg-hfsplus/

36
dmg-wrapper/ci-build-dmg.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
set -euo pipefail # Unofficial strict mode, see http://redsymbol.net/articles/unofficial-bash-strict-mode/
cd "$(dirname "$(readlink -f "$0")")"
# see https://stackoverflow.com/questions/3349105/how-can-i-set-the-current-working-directory-to-the-directory-of-the-script-in-ba
ARCH="$1"
JRETAR="$2"
APP="SheepIt"
DMG="$APP-$ARCH-raw.dmg"
FINAL="$APP-$ARCH.dmg"
BASE="$(pwd)"
BUILD="$BASE/build"
RES="$BUILD/SheepIt.app/Contents/Resources"
CL="$RES/client"
apt-get update
apt-get install -y --no-install-recommends genisoimage # Add dependencies
mkdir "$BUILD"
tar -axf "$APP.tar.gz" -C "$BUILD" # Extract base file structure + Platypus shell exec shim
tar -axf "$BASE/$JRETAR" -C "$RES" # Extracts the JRE into Resources folder
mkdir -p "$CL"
cp ../sheepit-client-all.jar "$CL/$APP.jar" # Copy client artifact to be packaged
cp "$BASE/$APP-Run.sh" "$CL"
cp "$BASE/$APP.png" "$CL"
cd "$CL"
ln -s "$(find ../ -name java)" $APP # We symlink java to make the title appearing in the dock to read "SheepIt", not "java"
cd "$BASE"
genisoimage -D -V $APP -no-pad -r -apple -o "$DMG" "$BUILD"
./dmg "$DMG" "$FINAL" # Use libdmg based dmg tool to compress the dmg (and also make it read-only)

BIN
dmg-wrapper/dmg Executable file

Binary file not shown.