From 63a219a32b4393b241601bba2e6dd19b52f83975 Mon Sep 17 00:00:00 2001 From: Nik Date: Fri, 17 Jan 2025 22:55:41 +0100 Subject: [PATCH] build: Added ARM64 AppImage build (#2073) --- .github/workflows/build.yml | 31 ++++++++++++++----- dist/{ => AppImage}/AppImageBuilder.yml | 41 ++++++++++--------------- dist/{appimage => AppImage}/Dockerfile | 8 ++++- dist/{ => macOS}/Brewfile | 0 4 files changed, 47 insertions(+), 33 deletions(-) rename dist/{ => AppImage}/AppImageBuilder.yml (78%) rename dist/{appimage => AppImage}/Dockerfile (86%) rename dist/{ => macOS}/Brewfile (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c4280e91..e150e2a17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,6 +107,8 @@ jobs: for plugin in install/plugins/*.hexplug; do ./cv2pdb/cv2pdb.exe $plugin done + + rm -rf cv2pdb - name: 📦 Bundle MSI run: | @@ -255,7 +257,7 @@ jobs: run: | brew reinstall python --quiet || true brew link --overwrite --quiet python 2>/dev/null || true - brew bundle --no-lock --quiet --file dist/Brewfile || true + brew bundle --no-lock --quiet --file dist/macOS/Brewfile || true rm -rf /usr/local/Cellar/capstone - name: ⬇️ Install classic glfw @@ -587,8 +589,21 @@ jobs: # AppImage build appimage: - runs-on: ubuntu-24.04 - name: ⬇️ AppImage + strategy: + fail-fast: false + matrix: + include: + - architecture: "x86_64" + architecture_package: "amd64" + architecture_appimage_builder: "x86_64" + image: ubuntu-24.04 + - architecture: "arm64" + architecture_package: "arm64" + architecture_appimage_builder: "aarch64" + image: ubuntu-24.04-arm + + runs-on: ${{ matrix.image }} + name: ⬇️ AppImage ${{ matrix.architecture }} permissions: id-token: write @@ -615,8 +630,10 @@ jobs: - name: 🛠️ Build using docker run: | - docker buildx build . -f dist/appimage/Dockerfile --progress=plain --build-arg "BUILD_TYPE=$BUILD_TYPE" \ - --build-arg "GIT_COMMIT_HASH=$GITHUB_SHA" --build-arg "GIT_BRANCH=${GITHUB_REF##*/}" --output out + docker buildx build . -f dist/AppImage/Dockerfile --progress=plain --build-arg "BUILD_TYPE=$BUILD_TYPE" \ + --build-arg "GIT_COMMIT_HASH=$GITHUB_SHA" --build-arg "GIT_BRANCH=${GITHUB_REF##*/}" \ + --build-arg "ARCHITECTURE_PACKAGE=${{ matrix.architecture_package }}" --build-arg "ARCHITECTURE_FILE_NAME=${{ matrix.architecture }}" --build-arg "ARCHITECTURE_APPIMAGE_BUILDER=${{ matrix.architecture_appimage_builder }}" \ + --output out - name: 🗝️ Generate build provenance attestations uses: actions/attest-build-provenance@v2 @@ -629,14 +646,14 @@ jobs: uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: Linux AppImage x86_64 + name: Linux AppImage ${{ matrix.architecture }} path: 'out/*.AppImage' - name: ⬆️ Upload AppImage zsync uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: Linux AppImage zsync x86_64 + name: Linux AppImage zsync ${{ matrix.architecture }} path: 'out/*.AppImage.zsync' # ArchLinux build diff --git a/dist/AppImageBuilder.yml b/dist/AppImage/AppImageBuilder.yml similarity index 78% rename from dist/AppImageBuilder.yml rename to dist/AppImage/AppImageBuilder.yml index dcb80905f..e8db47072 100644 --- a/dist/AppImageBuilder.yml +++ b/dist/AppImage/AppImageBuilder.yml @@ -11,32 +11,23 @@ AppDir: exec_args: $@ apt: arch: - - amd64 + - "{{ARCHITECTURE_PACKAGE}}" allow_unauthenticated: true sources: - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular main restricted - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-updates main restricted - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular universe - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-updates universe - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular multiverse - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-updates multiverse - - sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-backports main restricted - universe multiverse - - sourceline: deb http://security.ubuntu.com/ubuntu oracular-security main restricted - - sourceline: deb http://security.ubuntu.com/ubuntu oracular-security universe - - sourceline: deb http://security.ubuntu.com/ubuntu oracular-security multiverse + - sourceline: 'deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ oracular main restricted universe multiverse' + - sourceline: 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ oracular main restricted universe multiverse' include: - librsvg2-common - - libbz2-1.0:amd64 - - libcap2:amd64 - - libdbus-1-3:amd64 - - libfontconfig1:amd64 - - libgpg-error0:amd64 - - liblzma5:amd64 - - libnss-mdns:amd64 - - libpcre3:amd64 - - libselinux1:amd64 - - libtinfo6:amd64 + - libbz2-1.0 + - libcap2 + - libdbus-1-3 + - libfontconfig1 + - libgpg-error0 + - liblzma5 + - libnss-mdns + - libpcre3 + - libselinux1 + - libtinfo6 files: include: - /lib/x86_64-linux-gnu/libLLVM-13.so.1 @@ -133,6 +124,6 @@ AppDir: - usr/share/doc/*/NEWS.* - usr/share/doc/*/TODO.* AppImage: - arch: x86_64 - update-information: gh-releases-zsync|WerWolv|ImHex|latest|imhex-*-x86_64.AppImage.zsync - file_name: imhex-{{VERSION}}-x86_64.AppImage + arch: "{{ARCHITECTURE_APPIMAGE_BUILDER}}" + update-information: gh-releases-zsync|WerWolv|ImHex|latest|imhex-*-{{ARCHITECTURE_FILE_NAME}}.AppImage.zsync + file_name: imhex-{{VERSION}}-{{ARCHITECTURE_FILE_NAME}}.AppImage diff --git a/dist/appimage/Dockerfile b/dist/AppImage/Dockerfile similarity index 86% rename from dist/appimage/Dockerfile rename to dist/AppImage/Dockerfile index 79a456a2f..0944f0165 100644 --- a/dist/appimage/Dockerfile +++ b/dist/AppImage/Dockerfile @@ -30,6 +30,9 @@ ARG LTO=ON ARG BUILD_TYPE=RelWithDebInfo ARG GIT_COMMIT_HASH ARG GIT_BRANCH +ARG ARCHITECTURE_PACKAGE +ARG ARCHITECTURE_FILE_NAME +ARG ARCHITECTURE_APPIMAGE_BUILDER WORKDIR /build # Ubuntu sh doesnt support string substitution @@ -76,7 +79,10 @@ pip3 install git+https://github.com/AppImageCrafters/appimage-builder@f38699e # Package ImHex as AppImage export VERSION=$(cat /imhex/VERSION) -appimage-builder --recipe /imhex/dist/AppImageBuilder.yml +export ARCHITECTURE_PACKAGE=${ARCHITECTURE_PACKAGE} +export ARCHITECTURE_FILE_NAME=${ARCHITECTURE_FILE_NAME} +export ARCHITECTURE_APPIMAGE_BUILDER=${ARCHITECTURE_APPIMAGE_BUILDER} +appimage-builder --recipe /imhex/dist/AppImage/AppImageBuilder.yml EOF FROM scratch diff --git a/dist/Brewfile b/dist/macOS/Brewfile similarity index 100% rename from dist/Brewfile rename to dist/macOS/Brewfile