diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 90be388..d43a5dc 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -26,12 +26,16 @@ jobs: run: sudo apt-get install libgtkmm-3.0-dev gettext wget file - name: Download linuxdeploy + # Note: Using 'continuous' release for latest version. For reproducible builds, + # pin to a specific release tag and verify SHA256 checksum. run: | wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage chmod +x linuxdeploy-x86_64.AppImage sudo mv linuxdeploy-x86_64.AppImage /usr/local/bin/linuxdeploy - name: Download appimagetool + # Note: Using 'continuous' release for latest version. For reproducible builds, + # pin to a specific release tag and verify SHA256 checksum. run: | wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage chmod +x appimagetool-x86_64.AppImage @@ -107,7 +111,7 @@ jobs: id: version shell: bash run: | - VERSION=$(grep "CMAKE_PROJECT_VERSION" version.txt | cut -d'=' -f2 | tr -d ' ') + VERSION=$(sed -n 's/.*CMAKE_PROJECT_VERSION[[:space:]]*"\([^"]*\)".*/\1/p' version.txt) echo "VERSION=$VERSION" >> $GITHUB_OUTPUT echo "Version: $VERSION" diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index cab588f..5596b5d 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -6,12 +6,15 @@ # Generate files -configure_file("gsmartcontrol.appdata.in.xml" "gsmartcontrol.appdata.xml" ESCAPE_QUOTES @ONLY) if (APP_BUILD_APPIMAGE) - set(APPIMAGE_EXEC_LINE "Exec=\"@CMAKE_INSTALL_FULL_BINDIR@/gsmartcontrol\"") + set(APPIMAGE_DESKTOP_ID "dev.shaduri.gsmartcontrol") + set(APPIMAGE_EXEC_LINE "Exec=\"${CMAKE_INSTALL_FULL_BINDIR}/gsmartcontrol\"") + configure_file("gsmartcontrol.appdata.in.xml" "gsmartcontrol.appdata.xml" ESCAPE_QUOTES @ONLY) configure_file("gsmartcontrol.in.desktop" "dev.shaduri.gsmartcontrol.desktop" ESCAPE_QUOTES @ONLY) else() - set(APPIMAGE_EXEC_LINE "Exec=\"@CMAKE_INSTALL_FULL_BINDIR@/gsmartcontrol-root\"") + set(APPIMAGE_DESKTOP_ID "gsmartcontrol") + set(APPIMAGE_EXEC_LINE "Exec=\"${CMAKE_INSTALL_FULL_BINDIR}/gsmartcontrol-root\"") + configure_file("gsmartcontrol.appdata.in.xml" "gsmartcontrol.appdata.xml" ESCAPE_QUOTES @ONLY) configure_file("gsmartcontrol.in.desktop" "gsmartcontrol.desktop" ESCAPE_QUOTES @ONLY) endif() configure_file("gsmartcontrol-root.in.sh" "gsmartcontrol-root.sh" ESCAPE_QUOTES @ONLY) diff --git a/data/gsmartcontrol.appdata.in.xml b/data/gsmartcontrol.appdata.in.xml index 9988cce..c411ab1 100644 --- a/data/gsmartcontrol.appdata.in.xml +++ b/data/gsmartcontrol.appdata.in.xml @@ -14,7 +14,7 @@ on it.

- dev.shaduri.gsmartcontrol.desktop + @APPIMAGE_DESKTOP_ID@.desktop https://gsmartcontrol.shaduri.dev diff --git a/packaging/appimage/build-appimage.sh b/packaging/appimage/build-appimage.sh index 2af617c..c05c6d5 100755 --- a/packaging/appimage/build-appimage.sh +++ b/packaging/appimage/build-appimage.sh @@ -36,6 +36,8 @@ fi if ! command -v linuxdeploy &> /dev/null; then echo -e "${YELLOW}Warning: linuxdeploy not found. Will attempt to download it.${NC}" + # Note: Using 'continuous' release for latest version. For reproducible builds, + # pin to a specific release tag and verify SHA256 checksum. LINUXDEPLOY_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage" wget -N "$LINUXDEPLOY_URL" -O linuxdeploy chmod +x linuxdeploy @@ -46,6 +48,8 @@ fi if ! command -v appimagetool &> /dev/null; then echo -e "${YELLOW}Warning: appimagetool not found. Will attempt to download it.${NC}" + # Note: Using 'continuous' release for latest version. For reproducible builds, + # pin to a specific release tag and verify SHA256 checksum. APPIMAGETOOL_URL="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${ARCH}.AppImage" wget -N "$APPIMAGETOOL_URL" -O appimagetool chmod +x appimagetool @@ -121,8 +125,8 @@ if [ -d "$APPDIR/usr/lib/gdk-pixbuf-2.0" ]; then gdk-pixbuf-query-loaders > "$APPDIR/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" 2>/dev/null || true fi -# Get version from CMakeLists.txt -VERSION=$(grep "CMAKE_PROJECT_VERSION" version.txt | cut -d'=' -f2 | tr -d ' ') +# Get version from version.txt (extract quoted CMAKE_PROJECT_VERSION value) +VERSION=$(sed -n 's/.*CMAKE_PROJECT_VERSION[[:space:]]*"\([^"]*\)".*/\1/p' version.txt | head -n1) # Create AppImage echo -e "${GREEN}Creating AppImage...${NC}"