Skip to content

Appimage Multiarch Building #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/build-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,26 @@ on:
jobs:
appimage:
name: Build AppImage
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
container: docker
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-latest
arch: aarch64
steps:
- uses: actions/checkout@v4
- name: Build AppImage
run: |
docker build -t appimage-builder . -f burrow-gtk/build-aux/Dockerfile
docker build -t appimage-builder --build-arg="TARGET_ARCHITECTURE=${{ matrix.arch }}" . -f burrow-gtk/build-aux/Dockerfile
docker create --name temp appimage-builder
docker cp temp:/app/burrow-gtk/build-appimage/Burrow-x86_64.AppImage .
docker rm temp
- uses: actions/upload-artifact@v4
name: Upload to GitHub
with:
name: AppImage
path: Burrow-x86_64.AppImage
path: Burrow-${{ matrix.arch }}.AppImage
4 changes: 3 additions & 1 deletion burrow-gtk/build-aux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM fedora:39

ARG TARGET_ARCHITECTURE

ENV DEBIAN_FRONTEND=noninteractive

RUN set -eux && \
Expand All @@ -15,6 +17,6 @@ COPY . /app
ENV SQLITE3_STATIC=1

RUN cd /app/burrow-gtk/ && \
./build-aux/build_appimage.sh
TARGET_ARCHITECTURE=$TARGET_ARCHITECTURE ./build-aux/build_appimage.sh


18 changes: 12 additions & 6 deletions burrow-gtk/build-aux/build_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,33 @@ BURROW_GTK_ROOT="$(readlink -f $(dirname -- "$(readlink -f -- "$BASH_SOURCE")")/
BURROW_GTK_BUILD="$BURROW_GTK_ROOT/build-appimage"
LINUXDEPLOY_VERSION="${LINUXDEPLOY_VERSION:-"1-alpha-20240109-1"}"
BURROW_BUILD_TYPE="${BURROW_BUILD_TYPE:-"release"}"
HOST_ARCHITECTURE=$(lscpu | grep Architecture | awk '{print $2}')
TARGET_ARCHITECTURE="${TARGET_ARCHITECTURE:-"x86_64"}"
CARGO_FLAGS=""

if [ "$BURROW_GTK_ROOT" != $(pwd) ]; then
echo "Make sure to cd into burrow-gtk"
exit 1
fi

ARCHITECTURE=$(lscpu | grep Architecture | awk '{print $2}')

if [ "$ARCHITECTURE" == "x86_64" ]; then
if [ "$HOST_ARCHITECTURE" == "x86_64" ]; then
wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/$LINUXDEPLOY_VERSION/linuxdeploy-x86_64.AppImage" -o /dev/null -O /tmp/linuxdeploy
chmod a+x /tmp/linuxdeploy
elif [ "$ARCHITECTURE" == "aarch64" ]; then
elif [ "$HOST_ARCHITECTURE" == "aarch64" ]; then
wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/$LINUXDEPLOY_VERSION/linuxdeploy-aarch64.AppImage" -o /dev/null -O /tmp/linuxdeploy
chmod a+x /tmp/linuxdeploy
fi

if [ "$TARGET_ARCHITECTURE" == "x86_64" ]; then
CARGO_FLAGS="--target x86_64-unknown-linux-gnu"
elif [ "$TARGET_ARCHITECTURE" == "aarch64" ]; then
CARGO_FLAGS="--target aarch64-unknown-linux-gnu"
fi

CFLAGS="-I/usr/local/include -I/usr/include/$MUSL_TARGET -fPIE"
meson setup $BURROW_GTK_BUILD --bindir bin --prefix /usr --buildtype $BURROW_BUILD_TYPE
meson compile -C $BURROW_GTK_BUILD
DESTDIR=AppDir meson install -C $BURROW_GTK_BUILD
cargo b --$BURROW_BUILD_TYPE --manifest-path=../Cargo.toml
CARGO_FLAGS=$CARGO_FLAGS cargo b --$BURROW_BUILD_TYPE --manifest-path=../Cargo.toml
/tmp/linuxdeploy --appimage-extract-and-run --appdir $BURROW_GTK_BUILD/AppDir -e $BURROW_GTK_BUILD/../../target/$BURROW_BUILD_TYPE/burrow --output appimage
mv *.AppImage $BURROW_GTK_BUILD
mv *.AppImage $BURROW_GTK_BUILD/Burrow-${TARGET_ARCHITECTURE}
Loading