jan/src-tauri/build-utils/buildAppImage.sh
D. Rect. 7d04d66a0b refactor: pull appimage packaging steps out of github linux release workflow
- pulled appimage packaging steps out of release workflow into new
  src-tauri/build-utils/buildAppImage.sh
- cleaned up yarn scripts:
  - moved multi platform yarn scripts out of yarn build:tauri:<platform>
    into generic yarn build:tauri
  - split yarn build:tauri:linux:win32 into separate yarn scripts so it's
    clearer what is specific to which platform
- added src-tauri/build-utils/buildAppImage.sh to new yarn build:tauri:linux
  yarn script

    This is also a good entry point to add flatpak builds in the future.

    Part of #5641
2025-07-10 04:50:12 +00:00

33 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
APPIMAGETOOL="./.cache/build-tools/appimagetool"
RELEASE_CHANNEL=${RELEASE_CHANNEL:-"stable"}
# pull in AppImageTool if it's not pre cached
mkdir -p ./.cache/build-tools
if [ ! -f "${APPIMAGETOOL}" ]; then
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O "${APPIMAGETOOL}"
chmod +x "${APPIMAGETOOL}"
fi
if [ "${RELEASE_CHANNEL}" != "stable" ]; then
APP_DIR=./src-tauri/target/release/bundle/appimage/Jan-${RELEASE_CHANNEL}.AppDir
LIB_DIR=$APP_DIR/usr/lib/Jan-${RELEASE_CHANNEL}/binaries
else
APP_DIR=./src-tauri/target/release/bundle/appimage/Jan.AppDir
LIB_DIR=$APP_DIR/usr/lib/Jan/binaries
fi
# bundle additional resources in the AppDir without pulling in their dependencies
cp ./src-tauri/resources/bin/bun $APP_DIR/usr/bin/bun
mkdir -p $LIB_DIR/engines
cp -f ./src-tauri/binaries/deps/*.so* $LIB_DIR/
cp -f ./src-tauri/binaries/*.so* $LIB_DIR/
cp -rf ./src-tauri/binaries/engines $LIB_DIR/
# remove appimage generated by tauri build
APP_IMAGE=./src-tauri/target/release/bundle/appimage/$(ls ./src-tauri/target/release/bundle/appimage/ | grep AppImage | head -1)
echo $APP_IMAGE
rm -f $APP_IMAGE
# repackage appimage with additional resources
"${APPIMAGETOOL}" $APP_DIR $APP_IMAGE