Test build multiarch

This commit is contained in:
dav 2024-07-13 10:34:55 -07:00
parent e86fe3dfd2
commit 02fe1c023a
2 changed files with 14 additions and 10 deletions

View file

@ -16,17 +16,14 @@ jobs:
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
platform: Linux arch: x86_64
arch:
- x86_64
- os: ubuntu-latest - os: ubuntu-latest
arch: arch: aarch64
- aarch64
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Build AppImage - name: Build AppImage
run: | run: |
docker build -t appimage-builder --build-arg="ARCHITECTURE=${{ matrix.arch }}" . -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 create --name temp appimage-builder
docker cp temp:/app/burrow-gtk/build-appimage/Burrow-x86_64.AppImage . docker cp temp:/app/burrow-gtk/build-appimage/Burrow-x86_64.AppImage .
docker rm temp docker rm temp

View file

@ -6,27 +6,34 @@ BURROW_GTK_ROOT="$(readlink -f $(dirname -- "$(readlink -f -- "$BASH_SOURCE")")/
BURROW_GTK_BUILD="$BURROW_GTK_ROOT/build-appimage" BURROW_GTK_BUILD="$BURROW_GTK_ROOT/build-appimage"
LINUXDEPLOY_VERSION="${LINUXDEPLOY_VERSION:-"1-alpha-20240109-1"}" LINUXDEPLOY_VERSION="${LINUXDEPLOY_VERSION:-"1-alpha-20240109-1"}"
BURROW_BUILD_TYPE="${BURROW_BUILD_TYPE:-"release"}" BURROW_BUILD_TYPE="${BURROW_BUILD_TYPE:-"release"}"
CARGO_FLAGS=""
if [ "$BURROW_GTK_ROOT" != $(pwd) ]; then if [ "$BURROW_GTK_ROOT" != $(pwd) ]; then
echo "Make sure to cd into burrow-gtk" echo "Make sure to cd into burrow-gtk"
exit 1 exit 1
fi fi
ARCHITECTURE=$(lscpu | grep Architecture | awk '{print $2}') HOST_ARCHITECTURE=$(lscpu | grep Architecture | awk '{print $2}')
TARGET_ARCHITECTURE=""
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 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 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 wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/$LINUXDEPLOY_VERSION/linuxdeploy-aarch64.AppImage" -o /dev/null -O /tmp/linuxdeploy
chmod a+x /tmp/linuxdeploy chmod a+x /tmp/linuxdeploy
fi 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" 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 setup $BURROW_GTK_BUILD --bindir bin --prefix /usr --buildtype $BURROW_BUILD_TYPE
meson compile -C $BURROW_GTK_BUILD meson compile -C $BURROW_GTK_BUILD
DESTDIR=AppDir meson install -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 /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