From ff029e426f3d8e2425376b837e3975cb61b6a471 Mon Sep 17 00:00:00 2001 From: NoobNotFound <82730163+NoobNotFound@users.noreply.github.com> Date: Sat, 9 May 2026 15:03:59 +0530 Subject: [PATCH 1/6] Add Different Linux x64 packaging types for CI --- .github/steps/install_dependencies/action.yml | 2 +- .github/workflows/ci.yml | 229 ++++++++++++++++-- scripts/linux/AppImageBuilder.x64.yml | 47 ++++ scripts/linux/build-deb.sh | 43 ++++ scripts/linux/prepare-arch-package.sh | 38 +++ scripts/linux/publish-linux-x64.sh | 102 ++++++++ 6 files changed, 434 insertions(+), 27 deletions(-) create mode 100644 scripts/linux/AppImageBuilder.x64.yml create mode 100755 scripts/linux/build-deb.sh create mode 100755 scripts/linux/prepare-arch-package.sh create mode 100755 scripts/linux/publish-linux-x64.sh diff --git a/.github/steps/install_dependencies/action.yml b/.github/steps/install_dependencies/action.yml index 7619b886..6d714383 100644 --- a/.github/steps/install_dependencies/action.yml +++ b/.github/steps/install_dependencies/action.yml @@ -26,4 +26,4 @@ runs: if: runner.os == 'Linux' && inputs.job-platform == 'linux' run: | sudo apt-get update - sudo apt-get install -y libgtk-3-0 + sudo apt-get install -y desktop-file-utils lintian libgtk-3-0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9776e6c..266221dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -452,24 +452,12 @@ jobs: path: ${{ github.workspace }}/Emerald-macOS-arm64-app.zip retention-days: 14 - # Snap packages are built natively on each architecture — Uno Platform does not - # support cross-compilation for snap targets as of the current SDK version. publish-linux: - name: Linux Snap (${{ matrix.arch }}) + name: Linux x64 Packages needs: ci-filter if: ${{ needs.ci-filter.outputs.run_linux == 'true' }} - runs-on: ${{ matrix.runner }} + runs-on: ubuntu-22.04 timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - include: - - arch: x64 - runner: ubuntu-22.04 - runtime: linux-x64 - - arch: arm64 - runner: ubuntu-22.04-arm - runtime: linux-arm64 steps: - name: Checkout code @@ -482,9 +470,89 @@ jobs: with: job-platform: linux + - name: Publish Linux x64 app and stage shared package files + shell: bash + env: + PACKAGE_VERSION: ${{ needs.ci-filter.outputs.package_version }} + PUBLIC_VERSION: ${{ needs.ci-filter.outputs.public_version }} + UPDATE_CHANNEL: ${{ needs.ci-filter.outputs.release_channel }} + RELEASE_TAG: ${{ needs.ci-filter.outputs.release_tag }} + COMMIT_SHA: ${{ github.sha }} + BUILD_TIMESTAMP_UTC: ${{ needs.ci-filter.outputs.build_timestamp_utc }} + run: scripts/linux/publish-linux-x64.sh + + - name: Build Linux Debian package + shell: bash + env: + PACKAGE_VERSION: ${{ needs.ci-filter.outputs.package_version }} + run: scripts/linux/build-deb.sh + + - name: Build Linux AppImage + uses: AppImageCrafters/build-appimage-action@master + env: + EMERALD_PACKAGE_VERSION: ${{ needs.ci-filter.outputs.package_version }} + EMERALD_APPIMAGE_NAME: Emerald-linux-x86_64.AppImage + with: + recipe: scripts/linux/AppImageBuilder.x64.yml + + - name: Stage and validate Linux AppImage + shell: bash + run: | + set -euo pipefail + + APPIMAGE_FILE="$(find . -maxdepth 2 -name '*.AppImage' -type f | head -n 1)" + if [ -z "$APPIMAGE_FILE" ]; then + echo "No AppImage file found after appimage-builder completed" + exit 1 + fi + + STAGED="$GITHUB_WORKSPACE/artifacts/linux/final/Emerald-linux-x86_64.AppImage" + cp "$APPIMAGE_FILE" "$STAGED" + chmod +x "$STAGED" + "$STAGED" --appimage-extract >/dev/null + rm -rf squashfs-root + + - name: Prepare Linux Arch package recipe + shell: bash + env: + PACKAGE_VERSION: ${{ needs.ci-filter.outputs.package_version }} + run: scripts/linux/prepare-arch-package.sh + + - name: Build Linux Arch package + shell: bash + run: | + set -euo pipefail + + docker run --rm \ + -v "$GITHUB_WORKSPACE:/workspace" \ + -w /workspace/artifacts/linux/arch/pkgbuild \ + archlinux:base-devel \ + bash -lc ' + set -euo pipefail + useradd -m builder + chown -R builder:builder /workspace/artifacts/linux/arch + su builder -c "cd /workspace/artifacts/linux/arch/pkgbuild && makepkg --printsrcinfo > .SRCINFO && makepkg --packagelist && makepkg --nodeps --cleanbuild --force" + ' + + - name: Stage Linux Arch artifacts + shell: bash + run: | + set -euo pipefail + + PKGBUILD_DIR="$GITHUB_WORKSPACE/artifacts/linux/arch/pkgbuild" + FINAL_DIR="$GITHUB_WORKSPACE/artifacts/linux/final" + PKG_FILE="$(find "$PKGBUILD_DIR" -maxdepth 1 -name '*.pkg.tar.zst' -type f | head -n 1)" + if [ -z "$PKG_FILE" ]; then + echo "No Arch package file found after makepkg completed" + exit 1 + fi + + cp "$PKG_FILE" "$FINAL_DIR/emerald-${{ needs.ci-filter.outputs.package_version }}-1-x86_64.pkg.tar.zst" + tar -czf "$FINAL_DIR/emerald-aur-recipe.tar.gz" -C "$PKGBUILD_DIR" PKGBUILD .SRCINFO + # Snapcraft is installed after the base dependencies so that the snap daemon # is ready before we invoke dotnet publish with PackageFormat=snap. - # core22 matches the Ubuntu 22.04 runner base used by both matrix legs. + # core22 matches the Ubuntu 22.04 runner base. # --destructive-mode is required in CI because LXD/Multipass are unavailable # on single-use GitHub-hosted runners; it is safe here because the environment # is ephemeral and discarded after the job completes. @@ -497,16 +565,16 @@ jobs: sudo snap install snapcraft --classic sudo snap install multipass - - name: Publish Linux Snap (${{ matrix.arch }}) + - name: Publish Linux Snap shell: bash env: # Modern Snapcraft equivalent to --destructive-mode - SNAPCRAFT_BUILD_ENVIRONMENT: host + SNAPCRAFT_BUILD_ENVIRONMENT: host run: | dotnet publish ./Emerald/Emerald.csproj \ -c Release \ -f net10.0-desktop \ - -r "${{ matrix.runtime }}" \ + -r linux-x64 \ -p:SelfContained=true \ -p:PackageFormat=snap \ -p:UnoSnapBuildProvider=none \ @@ -537,27 +605,112 @@ jobs: fi echo "Found snap: $SNAP_FILE" - STAGED="$GITHUB_WORKSPACE/Emerald-linux-${{ matrix.arch }}.snap" + STAGED="$GITHUB_WORKSPACE/artifacts/linux/final/Emerald-linux-x64.snap" cp "$SNAP_FILE" "$STAGED" echo "snap_path=$STAGED" >> "$GITHUB_OUTPUT" - - name: Upload CI Linux Snap artifact (${{ matrix.arch }}) + - name: Upload CI Linux Snap artifact uses: actions/upload-artifact@v4 with: - name: Emerald-linux-${{ matrix.arch }}-snap + name: Emerald-linux-x64-snap path: ${{ steps.locate.outputs.snap_path }} if-no-files-found: error retention-days: 14 - - name: Upload release Linux Snap transfer artifact (${{ matrix.arch }}) + - name: Upload CI Linux tar artifact + uses: actions/upload-artifact@v4 + with: + name: Emerald-linux-x64-tar + path: ${{ github.workspace }}/artifacts/linux/final/Emerald-linux-x64.tar.gz + if-no-files-found: error + retention-days: 14 + + - name: Upload CI Linux AppImage artifact + uses: actions/upload-artifact@v4 + with: + name: Emerald-linux-x64-appimage + path: ${{ github.workspace }}/artifacts/linux/final/Emerald-linux-x86_64.AppImage + if-no-files-found: error + retention-days: 14 + + - name: Upload CI Linux Debian artifact + uses: actions/upload-artifact@v4 + with: + name: Emerald-linux-x64-deb + path: ${{ github.workspace }}/artifacts/linux/final/emerald_${{ needs.ci-filter.outputs.package_version }}_amd64.deb + if-no-files-found: error + retention-days: 14 + + - name: Upload CI Linux Arch artifact + uses: actions/upload-artifact@v4 + with: + name: Emerald-linux-x64-arch + path: ${{ github.workspace }}/artifacts/linux/final/emerald-${{ needs.ci-filter.outputs.package_version }}-1-x86_64.pkg.tar.zst + if-no-files-found: error + retention-days: 14 + + - name: Upload CI Linux AUR recipe artifact + uses: actions/upload-artifact@v4 + with: + name: Emerald-linux-x64-aur-recipe + path: ${{ github.workspace }}/artifacts/linux/final/emerald-aur-recipe.tar.gz + if-no-files-found: error + retention-days: 14 + + - name: Upload release Linux Snap transfer artifact if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} uses: actions/upload-artifact@v4 with: - name: Emerald-linux-${{ matrix.arch }}-ReleaseDraft-Snap + name: Emerald-linux-x64-ReleaseDraft-Snap path: ${{ steps.locate.outputs.snap_path }} if-no-files-found: error retention-days: 14 + - name: Upload release Linux tar transfer artifact + if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: Emerald-linux-x64-ReleaseDraft-Tar + path: ${{ github.workspace }}/artifacts/linux/final/Emerald-linux-x64.tar.gz + if-no-files-found: error + retention-days: 14 + + - name: Upload release Linux AppImage transfer artifact + if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: Emerald-linux-x64-ReleaseDraft-AppImage + path: ${{ github.workspace }}/artifacts/linux/final/Emerald-linux-x86_64.AppImage + if-no-files-found: error + retention-days: 14 + + - name: Upload release Linux Debian transfer artifact + if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: Emerald-linux-x64-ReleaseDraft-Deb + path: ${{ github.workspace }}/artifacts/linux/final/emerald_${{ needs.ci-filter.outputs.package_version }}_amd64.deb + if-no-files-found: error + retention-days: 14 + + - name: Upload release Linux Arch transfer artifact + if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: Emerald-linux-x64-ReleaseDraft-Arch + path: ${{ github.workspace }}/artifacts/linux/final/emerald-${{ needs.ci-filter.outputs.package_version }}-1-x86_64.pkg.tar.zst + if-no-files-found: error + retention-days: 14 + + - name: Upload release Linux AUR recipe transfer artifact + if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} + uses: actions/upload-artifact@v4 + with: + name: Emerald-linux-x64-ReleaseDraft-AUR-Recipe + path: ${{ github.workspace }}/artifacts/linux/final/emerald-aur-recipe.tar.gz + if-no-files-found: error + retention-days: 14 + draft-release: name: Draft GitHub Release needs: [ci-filter, publish-windows, publish-macos, publish-linux] @@ -591,10 +744,34 @@ jobs: name: Emerald-linux-x64-ReleaseDraft-Snap path: release-assets/linux - - name: Download Linux arm64 Snap artifact + - name: Download Linux x64 tar artifact + uses: actions/download-artifact@v4 + with: + name: Emerald-linux-x64-ReleaseDraft-Tar + path: release-assets/linux + + - name: Download Linux x64 AppImage artifact + uses: actions/download-artifact@v4 + with: + name: Emerald-linux-x64-ReleaseDraft-AppImage + path: release-assets/linux + + - name: Download Linux x64 Debian artifact + uses: actions/download-artifact@v4 + with: + name: Emerald-linux-x64-ReleaseDraft-Deb + path: release-assets/linux + + - name: Download Linux x64 Arch artifact + uses: actions/download-artifact@v4 + with: + name: Emerald-linux-x64-ReleaseDraft-Arch + path: release-assets/linux + + - name: Download Linux x64 AUR recipe artifact uses: actions/download-artifact@v4 with: - name: Emerald-linux-arm64-ReleaseDraft-Snap + name: Emerald-linux-x64-ReleaseDraft-AUR-Recipe path: release-assets/linux - name: Build release metadata files @@ -655,4 +832,4 @@ jobs: generate_release_notes: true files: ${{ steps.files.outputs.files }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/linux/AppImageBuilder.x64.yml b/scripts/linux/AppImageBuilder.x64.yml new file mode 100644 index 00000000..6e7ab99d --- /dev/null +++ b/scripts/linux/AppImageBuilder.x64.yml @@ -0,0 +1,47 @@ +version: 1 + +AppDir: + path: ./artifacts/linux/appimage/AppDir + app_info: + id: com.riversidevalley.Emerald + name: Emerald + icon: emerald + version: !ENV ${EMERALD_PACKAGE_VERSION} + exec: usr/bin/emerald + exec_args: $@ + runtime: + env: + APPDIR_LIBRARY_PATH: '$APPDIR/usr/lib/emerald:$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu' + GTK_THEME: Default + apt: + arch: amd64 + sources: + - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse + - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse + - sourceline: deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse + include: + - libgtk-3-0 + - libgtk-3-bin + - libgtk-3-common + - libx11-6 + - libfontconfig1 + - libfreetype6 + - libgcc-s1 + - libstdc++6 + - libcanberra-gtk3-module + exclude: + - hicolor-icon-theme + - humanity-icon-theme + files: + exclude: + - usr/share/man + - usr/share/doc/*/README.* + - usr/share/doc/*/changelog.* + - usr/share/doc/*/NEWS.* + - usr/share/doc/*/TODO.* + +AppImage: + arch: x86_64 + file_name: !ENV ${EMERALD_APPIMAGE_NAME} + update-information: None + sign-key: None diff --git a/scripts/linux/build-deb.sh b/scripts/linux/build-deb.sh new file mode 100755 index 00000000..b1fcb2a2 --- /dev/null +++ b/scripts/linux/build-deb.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +set -euo pipefail + +OUTPUT_ROOT="${OUTPUT_ROOT:-$PWD/artifacts/linux}" +PACKAGE_VERSION="${PACKAGE_VERSION:?PACKAGE_VERSION is required}" +INSTALL_ROOT="$OUTPUT_ROOT/install-root" +DEB_ROOT="$OUTPUT_ROOT/deb/root" +FINAL_DIR="$OUTPUT_ROOT/final" +DEB_PATH="$FINAL_DIR/emerald_${PACKAGE_VERSION}_amd64.deb" + +if [ ! -d "$INSTALL_ROOT/opt/emerald" ]; then + echo "Install root was not found. Run scripts/linux/publish-linux-x64.sh first." + exit 1 +fi + +rm -rf "$DEB_ROOT" +mkdir -p "$DEB_ROOT/DEBIAN" "$FINAL_DIR" +cp -a "$INSTALL_ROOT/." "$DEB_ROOT/" + +INSTALLED_SIZE="$(du -sk "$DEB_ROOT/opt/emerald" "$DEB_ROOT/usr" | awk '{total += $1} END {print total}')" + +cat > "$DEB_ROOT/DEBIAN/control" < +Installed-Size: $INSTALLED_SIZE +Depends: libgtk-3-0, libx11-6, libfontconfig1, libfreetype6, libgcc-s1, libstdc++6, libc6 +Homepage: https://github.com/RiversideValley/Emerald +Description: Open-source cross-platform Minecraft launcher + Emerald is an open-source cross-platform Minecraft launcher made with .NET. +EOF + +find "$DEB_ROOT" -type d -exec chmod 755 {} + +chmod 644 "$DEB_ROOT/DEBIAN/control" +dpkg-deb --build --root-owner-group "$DEB_ROOT" "$DEB_PATH" +dpkg-deb --info "$DEB_PATH" + +if command -v lintian >/dev/null 2>&1; then + lintian "$DEB_PATH" || true +fi diff --git a/scripts/linux/prepare-arch-package.sh b/scripts/linux/prepare-arch-package.sh new file mode 100755 index 00000000..8e6b851e --- /dev/null +++ b/scripts/linux/prepare-arch-package.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -euo pipefail + +OUTPUT_ROOT="${OUTPUT_ROOT:-$PWD/artifacts/linux}" +PACKAGE_VERSION="${PACKAGE_VERSION:?PACKAGE_VERSION is required}" +INSTALL_ROOT="$OUTPUT_ROOT/install-root" +ARCH_ROOT="$OUTPUT_ROOT/arch" +PKGBUILD_DIR="$ARCH_ROOT/pkgbuild" +SOURCE_ROOT="$ARCH_ROOT/source" +SOURCE_NAME="emerald-${PACKAGE_VERSION}-1-x86_64.tar.gz" + +if [ ! -d "$INSTALL_ROOT/opt/emerald" ]; then + echo "Install root was not found. Run scripts/linux/publish-linux-x64.sh first." + exit 1 +fi + +rm -rf "$ARCH_ROOT" +mkdir -p "$PKGBUILD_DIR" "$SOURCE_ROOT/package" +cp -a "$INSTALL_ROOT/." "$SOURCE_ROOT/package/" +tar -czf "$PKGBUILD_DIR/$SOURCE_NAME" -C "$SOURCE_ROOT" package +SOURCE_SHA256="$(sha256sum "$PKGBUILD_DIR/$SOURCE_NAME" | awk '{print $1}')" + +cat > "$PKGBUILD_DIR/PKGBUILD" < "$INSTALL_ROOT/usr/bin/emerald" <<'EOF' +#!/usr/bin/env sh +exec /opt/emerald/Emerald "$@" +EOF +chmod 755 "$INSTALL_ROOT/usr/bin/emerald" + +install -dm755 "$INSTALL_ROOT/usr/share/applications" +cat > "$INSTALL_ROOT/usr/share/applications/emerald.desktop" <<'EOF' +[Desktop Entry] +Name=Emerald +Comment=Open-source cross-platform Minecraft launcher +Exec=emerald +Icon=emerald +Terminal=false +Type=Application +Categories=Game; +EOF + +install -dm755 "$INSTALL_ROOT/usr/share/icons/hicolor/256x256/apps" +install -m644 "$PWD/Emerald/Assets/icon.png" "$INSTALL_ROOT/usr/share/icons/hicolor/256x256/apps/emerald.png" + +install -dm755 "$INSTALL_ROOT/usr/share/doc/emerald" "$INSTALL_ROOT/usr/share/licenses/emerald" +install -m644 "$PWD/LICENSE.md" "$INSTALL_ROOT/usr/share/doc/emerald/copyright" +install -m644 "$PWD/LICENSE.md" "$INSTALL_ROOT/usr/share/licenses/emerald/LICENSE.md" + +if command -v desktop-file-validate >/dev/null 2>&1; then + desktop-file-validate "$INSTALL_ROOT/usr/share/applications/emerald.desktop" +fi + +install -dm755 "$APPDIR/usr/lib/emerald" "$APPDIR/usr/bin" "$APPDIR/usr/share/applications" "$APPDIR/usr/share/icons/hicolor/256x256/apps" +cp -a "$PUBLISH_DIR/." "$APPDIR/usr/lib/emerald/" +install -m644 "$INSTALL_ROOT/usr/share/applications/emerald.desktop" "$APPDIR/usr/share/applications/emerald.desktop" +install -m644 "$INSTALL_ROOT/usr/share/icons/hicolor/256x256/apps/emerald.png" "$APPDIR/usr/share/icons/hicolor/256x256/apps/emerald.png" +ln -sf "usr/share/applications/emerald.desktop" "$APPDIR/emerald.desktop" +ln -sf "usr/share/icons/hicolor/256x256/apps/emerald.png" "$APPDIR/emerald.png" +ln -sf "emerald.png" "$APPDIR/.DirIcon" + +cat > "$APPDIR/usr/bin/emerald" <<'EOF' +#!/usr/bin/env sh +APPDIR="${APPDIR:-$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)}" +export LD_LIBRARY_PATH="$APPDIR/usr/lib/emerald${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" +exec "$APPDIR/usr/lib/emerald/Emerald" "$@" +EOF +chmod 755 "$APPDIR/usr/bin/emerald" + +cat > "$APPDIR/AppRun" <<'EOF' +#!/usr/bin/env sh +HERE="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" +exec "$HERE/usr/bin/emerald" "$@" +EOF +chmod 755 "$APPDIR/AppRun" From 94fdc4506b328776ad98e111f026ea7b8138798e Mon Sep 17 00:00:00 2001 From: NoobNotFound <82730163+NoobNotFound@users.noreply.github.com> Date: Sat, 9 May 2026 15:15:41 +0530 Subject: [PATCH 2/6] Rename Linux artifacts and add AppImage key Remove explicit Linux release upload steps from .github/workflows/ci.yml and update downstream download steps to use new, shorter artifact names (emerald linux snap/tar/appimage/deb/arch/aur-recipe). Add a key_url entry to scripts/linux/AppImageBuilder.x64.yml to fetch the Ubuntu signing key (0x871920D1991BC93C) for apt sources used by the AppImage build. These changes consolidate artifact naming and ensure the AppImage builder has the repository key available. --- .github/workflows/ci.yml | 66 +++------------------------ scripts/linux/AppImageBuilder.x64.yml | 1 + 2 files changed, 7 insertions(+), 60 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 266221dc..7fcc61b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -657,60 +657,6 @@ jobs: if-no-files-found: error retention-days: 14 - - name: Upload release Linux Snap transfer artifact - if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} - uses: actions/upload-artifact@v4 - with: - name: Emerald-linux-x64-ReleaseDraft-Snap - path: ${{ steps.locate.outputs.snap_path }} - if-no-files-found: error - retention-days: 14 - - - name: Upload release Linux tar transfer artifact - if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} - uses: actions/upload-artifact@v4 - with: - name: Emerald-linux-x64-ReleaseDraft-Tar - path: ${{ github.workspace }}/artifacts/linux/final/Emerald-linux-x64.tar.gz - if-no-files-found: error - retention-days: 14 - - - name: Upload release Linux AppImage transfer artifact - if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} - uses: actions/upload-artifact@v4 - with: - name: Emerald-linux-x64-ReleaseDraft-AppImage - path: ${{ github.workspace }}/artifacts/linux/final/Emerald-linux-x86_64.AppImage - if-no-files-found: error - retention-days: 14 - - - name: Upload release Linux Debian transfer artifact - if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} - uses: actions/upload-artifact@v4 - with: - name: Emerald-linux-x64-ReleaseDraft-Deb - path: ${{ github.workspace }}/artifacts/linux/final/emerald_${{ needs.ci-filter.outputs.package_version }}_amd64.deb - if-no-files-found: error - retention-days: 14 - - - name: Upload release Linux Arch transfer artifact - if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} - uses: actions/upload-artifact@v4 - with: - name: Emerald-linux-x64-ReleaseDraft-Arch - path: ${{ github.workspace }}/artifacts/linux/final/emerald-${{ needs.ci-filter.outputs.package_version }}-1-x86_64.pkg.tar.zst - if-no-files-found: error - retention-days: 14 - - - name: Upload release Linux AUR recipe transfer artifact - if: ${{ needs.ci-filter.outputs.is_release_flow == 'true' }} - uses: actions/upload-artifact@v4 - with: - name: Emerald-linux-x64-ReleaseDraft-AUR-Recipe - path: ${{ github.workspace }}/artifacts/linux/final/emerald-aur-recipe.tar.gz - if-no-files-found: error - retention-days: 14 - draft-release: name: Draft GitHub Release needs: [ci-filter, publish-windows, publish-macos, publish-linux] @@ -741,37 +687,37 @@ jobs: - name: Download Linux x64 Snap artifact uses: actions/download-artifact@v4 with: - name: Emerald-linux-x64-ReleaseDraft-Snap + name: Emerald-linux-x64-snap path: release-assets/linux - name: Download Linux x64 tar artifact uses: actions/download-artifact@v4 with: - name: Emerald-linux-x64-ReleaseDraft-Tar + name: Emerald-linux-x64-tar path: release-assets/linux - name: Download Linux x64 AppImage artifact uses: actions/download-artifact@v4 with: - name: Emerald-linux-x64-ReleaseDraft-AppImage + name: Emerald-linux-x64-appimage path: release-assets/linux - name: Download Linux x64 Debian artifact uses: actions/download-artifact@v4 with: - name: Emerald-linux-x64-ReleaseDraft-Deb + name: Emerald-linux-x64-deb path: release-assets/linux - name: Download Linux x64 Arch artifact uses: actions/download-artifact@v4 with: - name: Emerald-linux-x64-ReleaseDraft-Arch + name: Emerald-linux-x64-arch path: release-assets/linux - name: Download Linux x64 AUR recipe artifact uses: actions/download-artifact@v4 with: - name: Emerald-linux-x64-ReleaseDraft-AUR-Recipe + name: Emerald-linux-x64-aur-recipe path: release-assets/linux - name: Build release metadata files diff --git a/scripts/linux/AppImageBuilder.x64.yml b/scripts/linux/AppImageBuilder.x64.yml index 6e7ab99d..3410ed5f 100644 --- a/scripts/linux/AppImageBuilder.x64.yml +++ b/scripts/linux/AppImageBuilder.x64.yml @@ -17,6 +17,7 @@ AppDir: arch: amd64 sources: - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse + key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C' - sourceline: deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse - sourceline: deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse include: From 65183108adf66073a17ceea9395586d320a1927d Mon Sep 17 00:00:00 2001 From: NoobNotFound <82730163+NoobNotFound@users.noreply.github.com> Date: Sat, 9 May 2026 15:25:12 +0530 Subject: [PATCH 3/6] Adjust AppImage paths and add CI AppDir checks Add a CI verification step to ensure the AppDir contains the expected files (executable binary at usr/lib/emerald/Emerald, wrapper at usr/bin/emerald, emerald.desktop and emerald.png). Update AppImageBuilder config to use ./AppDir, fix the exec entry to point at usr/lib/emerald/Emerald, and exclude kernel/systemd/init-related paths from the bundle. Make publish script default APPDIR to $PWD/AppDir so publishing uses the same AppDir layout. [ci-linux] --- .github/workflows/ci.yml | 10 ++++++++++ scripts/linux/AppImageBuilder.x64.yml | 9 +++++++-- scripts/linux/publish-linux-x64.sh | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fcc61b4..f08951dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -487,6 +487,16 @@ jobs: PACKAGE_VERSION: ${{ needs.ci-filter.outputs.package_version }} run: scripts/linux/build-deb.sh + - name: Verify Linux AppDir staging + shell: bash + run: | + set -euo pipefail + + test -x "$GITHUB_WORKSPACE/AppDir/usr/lib/emerald/Emerald" + test -x "$GITHUB_WORKSPACE/AppDir/usr/bin/emerald" + test -f "$GITHUB_WORKSPACE/AppDir/emerald.desktop" + test -f "$GITHUB_WORKSPACE/AppDir/emerald.png" + - name: Build Linux AppImage uses: AppImageCrafters/build-appimage-action@master env: diff --git a/scripts/linux/AppImageBuilder.x64.yml b/scripts/linux/AppImageBuilder.x64.yml index 3410ed5f..9aea9676 100644 --- a/scripts/linux/AppImageBuilder.x64.yml +++ b/scripts/linux/AppImageBuilder.x64.yml @@ -1,13 +1,13 @@ version: 1 AppDir: - path: ./artifacts/linux/appimage/AppDir + path: ./AppDir app_info: id: com.riversidevalley.Emerald name: Emerald icon: emerald version: !ENV ${EMERALD_PACKAGE_VERSION} - exec: usr/bin/emerald + exec: usr/lib/emerald/Emerald exec_args: $@ runtime: env: @@ -40,6 +40,11 @@ AppDir: - usr/share/doc/*/changelog.* - usr/share/doc/*/NEWS.* - usr/share/doc/*/TODO.* + - usr/bin/kernel-install + - usr/lib/kernel + - usr/share/bug + - lib/systemd + - etc/init.d AppImage: arch: x86_64 diff --git a/scripts/linux/publish-linux-x64.sh b/scripts/linux/publish-linux-x64.sh index 3777e7dd..f0e67842 100755 --- a/scripts/linux/publish-linux-x64.sh +++ b/scripts/linux/publish-linux-x64.sh @@ -13,7 +13,7 @@ BUILD_TIMESTAMP_UTC="${BUILD_TIMESTAMP_UTC:?BUILD_TIMESTAMP_UTC is required}" PUBLISH_ROOT="$OUTPUT_ROOT/publish" PUBLISH_DIR="$PUBLISH_ROOT/Emerald-linux-x64" INSTALL_ROOT="$OUTPUT_ROOT/install-root" -APPDIR="$OUTPUT_ROOT/appimage/AppDir" +APPDIR="${APPDIR:-$PWD/AppDir}" FINAL_DIR="$OUTPUT_ROOT/final" rm -rf "$PUBLISH_DIR" "$INSTALL_ROOT" "$APPDIR" From 15dfde21bea416b036014437cd2cc2358be40d64 Mon Sep 17 00:00:00 2001 From: NoobNotFound <82730163+NoobNotFound@users.noreply.github.com> Date: Sat, 9 May 2026 15:36:06 +0530 Subject: [PATCH 4/6] try to fix again --- .github/workflows/ci.yml | 4 ++-- scripts/linux/publish-linux-x64.sh | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f08951dd..81cbb517 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -494,8 +494,8 @@ jobs: test -x "$GITHUB_WORKSPACE/AppDir/usr/lib/emerald/Emerald" test -x "$GITHUB_WORKSPACE/AppDir/usr/bin/emerald" - test -f "$GITHUB_WORKSPACE/AppDir/emerald.desktop" - test -f "$GITHUB_WORKSPACE/AppDir/emerald.png" + test -f "$GITHUB_WORKSPACE/AppDir/usr/share/applications/emerald.desktop" + test -f "$GITHUB_WORKSPACE/AppDir/usr/share/icons/hicolor/256x256/apps/emerald.png" - name: Build Linux AppImage uses: AppImageCrafters/build-appimage-action@master diff --git a/scripts/linux/publish-linux-x64.sh b/scripts/linux/publish-linux-x64.sh index f0e67842..36989c60 100755 --- a/scripts/linux/publish-linux-x64.sh +++ b/scripts/linux/publish-linux-x64.sh @@ -82,9 +82,6 @@ install -dm755 "$APPDIR/usr/lib/emerald" "$APPDIR/usr/bin" "$APPDIR/usr/share/ap cp -a "$PUBLISH_DIR/." "$APPDIR/usr/lib/emerald/" install -m644 "$INSTALL_ROOT/usr/share/applications/emerald.desktop" "$APPDIR/usr/share/applications/emerald.desktop" install -m644 "$INSTALL_ROOT/usr/share/icons/hicolor/256x256/apps/emerald.png" "$APPDIR/usr/share/icons/hicolor/256x256/apps/emerald.png" -ln -sf "usr/share/applications/emerald.desktop" "$APPDIR/emerald.desktop" -ln -sf "usr/share/icons/hicolor/256x256/apps/emerald.png" "$APPDIR/emerald.png" -ln -sf "emerald.png" "$APPDIR/.DirIcon" cat > "$APPDIR/usr/bin/emerald" <<'EOF' #!/usr/bin/env sh @@ -93,10 +90,3 @@ export LD_LIBRARY_PATH="$APPDIR/usr/lib/emerald${LD_LIBRARY_PATH:+:$LD_LIBRARY_P exec "$APPDIR/usr/lib/emerald/Emerald" "$@" EOF chmod 755 "$APPDIR/usr/bin/emerald" - -cat > "$APPDIR/AppRun" <<'EOF' -#!/usr/bin/env sh -HERE="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" -exec "$HERE/usr/bin/emerald" "$@" -EOF -chmod 755 "$APPDIR/AppRun" From c9a6f943cdaf6f5c573d263f347426bccc9cb8e3 Mon Sep 17 00:00:00 2001 From: NoobNotFound <82730163+NoobNotFound@users.noreply.github.com> Date: Sat, 9 May 2026 15:44:43 +0530 Subject: [PATCH 5/6] Run appimage-builder in Docker; add desktop file Replace the GitHub action call with an explicit docker run of appimagecrafters/appimage-builder:1.1.0 that installs squashfs-tools and invokes appimage-builder with the x64 recipe (skipping its internal tests). Add CI checks for and install an additional desktop filename (com.riversidevalley.Emerald.desktop) into the AppDir so both desktop file paths are present during validation. --- .github/workflows/ci.yml | 15 ++++++++++++--- scripts/linux/publish-linux-x64.sh | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81cbb517..464df49e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -495,15 +495,24 @@ jobs: test -x "$GITHUB_WORKSPACE/AppDir/usr/lib/emerald/Emerald" test -x "$GITHUB_WORKSPACE/AppDir/usr/bin/emerald" test -f "$GITHUB_WORKSPACE/AppDir/usr/share/applications/emerald.desktop" + test -f "$GITHUB_WORKSPACE/AppDir/usr/share/applications/com.riversidevalley.Emerald.desktop" test -f "$GITHUB_WORKSPACE/AppDir/usr/share/icons/hicolor/256x256/apps/emerald.png" - name: Build Linux AppImage - uses: AppImageCrafters/build-appimage-action@master + shell: bash env: EMERALD_PACKAGE_VERSION: ${{ needs.ci-filter.outputs.package_version }} EMERALD_APPIMAGE_NAME: Emerald-linux-x86_64.AppImage - with: - recipe: scripts/linux/AppImageBuilder.x64.yml + run: | + set -euo pipefail + + docker run --rm \ + -e "EMERALD_PACKAGE_VERSION=$EMERALD_PACKAGE_VERSION" \ + -e "EMERALD_APPIMAGE_NAME=$EMERALD_APPIMAGE_NAME" \ + -v "$GITHUB_WORKSPACE:/github/workspace" \ + -w /github/workspace \ + appimagecrafters/appimage-builder:1.1.0 \ + bash -lc 'apt-get update && apt-get install -y squashfs-tools && appimage-builder --recipe=scripts/linux/AppImageBuilder.x64.yml --skip-test' - name: Stage and validate Linux AppImage shell: bash diff --git a/scripts/linux/publish-linux-x64.sh b/scripts/linux/publish-linux-x64.sh index 36989c60..ae257d75 100755 --- a/scripts/linux/publish-linux-x64.sh +++ b/scripts/linux/publish-linux-x64.sh @@ -81,6 +81,7 @@ fi install -dm755 "$APPDIR/usr/lib/emerald" "$APPDIR/usr/bin" "$APPDIR/usr/share/applications" "$APPDIR/usr/share/icons/hicolor/256x256/apps" cp -a "$PUBLISH_DIR/." "$APPDIR/usr/lib/emerald/" install -m644 "$INSTALL_ROOT/usr/share/applications/emerald.desktop" "$APPDIR/usr/share/applications/emerald.desktop" +install -m644 "$INSTALL_ROOT/usr/share/applications/emerald.desktop" "$APPDIR/usr/share/applications/com.riversidevalley.Emerald.desktop" install -m644 "$INSTALL_ROOT/usr/share/icons/hicolor/256x256/apps/emerald.png" "$APPDIR/usr/share/icons/hicolor/256x256/apps/emerald.png" cat > "$APPDIR/usr/bin/emerald" <<'EOF' From ff02594bbd119ef756a9da4dd0e6b93b44ed54c6 Mon Sep 17 00:00:00 2001 From: NoobNotFound <82730163+NoobNotFound@users.noreply.github.com> Date: Sat, 9 May 2026 15:58:00 +0530 Subject: [PATCH 6/6] fix snap locate --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 464df49e..09d78150 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -519,7 +519,7 @@ jobs: run: | set -euo pipefail - APPIMAGE_FILE="$(find . -maxdepth 2 -name '*.AppImage' -type f | head -n 1)" + APPIMAGE_FILE="$(find "$GITHUB_WORKSPACE" -maxdepth 1 -name '*.AppImage' -type f -print -quit)" if [ -z "$APPIMAGE_FILE" ]; then echo "No AppImage file found after appimage-builder completed" exit 1 @@ -617,7 +617,11 @@ jobs: run: | # Uno places the .snap in the publish output folder; find it regardless # of the exact versioned filename that snapcraft generates. - SNAP_FILE="$(find . -name '*.snap' -not -path '*/.git/*' -type f | head -n 1)" + SNAP_FILE="$(find "$GITHUB_WORKSPACE" \ + \( -path "$GITHUB_WORKSPACE/.git" \ + -o -path "$GITHUB_WORKSPACE/AppDir" \ + -o -path "$GITHUB_WORKSPACE/appimage-build" \) -prune \ + -o -name '*.snap' -type f -print -quit)" if [ -z "$SNAP_FILE" ]; then echo "No .snap file found after publish" exit 1