diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de6c1c0..b1c9991 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,12 +13,8 @@ jobs: include: - ARCH: x86_64 RUNS_ON: ubuntu-24.04 - - ARCH: i686 - RUNS_ON: ubuntu-24.04 - ARCH: aarch64 RUNS_ON: ubuntu-24.04-arm - - ARCH: armhf - RUNS_ON: ubuntu-24.04-arm name: AppImage ${{ matrix.ARCH }} runs-on: ${{ matrix.RUNS_ON }} diff --git a/ci/build-appimages.sh b/ci/build-appimages.sh index 654f88e..7a16d88 100755 --- a/ci/build-appimages.sh +++ b/ci/build-appimages.sh @@ -1,15 +1,11 @@ -#! /bin/bash +#!/bin/sh -set -x -set -e -set -o pipefail +set -ex + +export APPIMAGE_EXTRACT_AND_RUN=1 # use RAM disk if possible -if [ "$CI" == "" ] && [ -d /dev/shm ]; then - TEMP_BASE=/dev/shm -else - TEMP_BASE=/tmp -fi +TEMP_BASE=/tmp BUILD_DIR="$(mktemp -d -p "$TEMP_BASE" AppImageUpdate-build-XXXXXX)" @@ -25,25 +21,20 @@ trap cleanup EXIT REPO_ROOT="$(readlink -f "$(dirname "$(dirname "$0")")")" OLD_CWD="$(readlink -f .)" -pushd "$BUILD_DIR" +cd "$BUILD_DIR" export ARCH=${ARCH:-"$(uname -m)"} -if [ "$ARCH" == "i386" ] && [ "$DOCKER" == "" ]; then - EXTRA_CMAKE_ARGS=("-DCMAKE_TOOLCHAIN_FILE=$REPO_ROOT/cmake/toolchains/i386-linux-gnu.cmake") -fi - cmake "$REPO_ROOT" \ -DBUILD_QT_UI=ON \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - "${EXTRA_CMAKE_ARGS[@]}" + -DCMAKE_BUILD_TYPE=MinSizeRel # next step is to build the binaries make -j"$(nproc)" # set up the AppDirs initially -for appdir in {appimageupdatetool,AppImageUpdate,validate}.AppDir; do +for appdir in appimageupdatetool.AppDir validate.AppDir; do make install DESTDIR="$appdir" mkdir -p "$appdir"/resources cp -v "$REPO_ROOT"/resources/*.xpm "$appdir"/resources/ @@ -61,8 +52,6 @@ fi # remove unnecessary binaries from AppDirs -rm AppImageUpdate.AppDir/usr/bin/appimageupdatetool -rm AppImageUpdate.AppDir/usr/bin/validate rm appimageupdatetool.AppDir/usr/bin/AppImageUpdate rm appimageupdatetool.AppDir/usr/bin/validate rm appimageupdatetool.AppDir/usr/lib/*/libappimageupdate-qt*.so* @@ -71,8 +60,8 @@ rm validate.AppDir/usr/lib/*/libappimageupdate*.so* # remove other unnecessary data -find {appimageupdatetool,AppImageUpdate,validate}.AppDir -type f -iname '*.a' -delete -rm -rf {appimageupdatetool,AppImageUpdate}.AppDir/usr/include +find {appimageupdatetool,validate}.AppDir -type f -iname '*.a' -delete +rm -rf appimageupdatetool.AppDir/usr/include # get linuxdeploy and its qt plugin @@ -81,34 +70,20 @@ wget https://github.com/TheAssassin/linuxdeploy-plugin-qt/releases/download/cont wget https://github.com/darealshinji/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt.sh chmod +x linuxdeploy*.AppImage linuxdeploy-plugin-checkrt.sh -patch_appimage() { - while [[ "$1" != "" ]]; do - dd if=/dev/zero of="$1" conv=notrunc bs=1 count=3 seek=8 - shift - done -} -patch_appimage linuxdeploy*.AppImage - -for app in appimageupdatetool AppImageUpdate validate; do - find "$app".AppDir/ - - export UPD_INFO="gh-releases-zsync|pkgforge-dev|AppImageUpdate|continuous|$app-*$ARCH.AppImage.zsync" - - # note that we need to overwrite this in every iteration, otherwise the value will leak into the following iterationso - extra_flags=() - if [ "$app" == "AppImageUpdate" ]; then - extra_flags=("--plugin" "qt"); - fi - - # overwrite AppImage filename to get static filenames - # see https://github.com/AppImage/AppImageUpdate/issues/89 - export OUTPUT="$app"-"$ARCH".AppImage - - # bundle application - ./linuxdeploy-"$CMAKE_ARCH".AppImage --appdir "$app".AppDir --output appimage "${extra_flags[@]}" -d "$REPO_ROOT"/resources/"$app".desktop -i "$REPO_ROOT"/resources/appimage.png --plugin checkrt +for app in appimageupdatetool validate; do + find "$app".AppDir/ + export UPD_INFO="gh-releases-zsync|pkgforge-dev|AppImageUpdate|continuous|$app-*$ARCH.AppImage.zsync" + + # overwrite AppImage filename to get static filenames + # see https://github.com/AppImage/AppImageUpdate/issues/89 + export OUTPUT="$app"-"$ARCH".AppImage + + # bundle application + ./linuxdeploy-"$CMAKE_ARCH".AppImage --appdir "$app".AppDir --output appimage -d "$REPO_ROOT"/resources/"$app".desktop -i "$REPO_ROOT"/resources/appimage.png --plugin checkrt done # move AppImages to old cwd -mv {appimageupdatetool,AppImageUpdate,validate}*.AppImage* "$OLD_CWD"/ +mv appimageupdatetool*.AppImage* "$OLD_CWD"/ +mv validate*.AppImage* "$OLD_CWD"/ -popd +cd -