Skip to content
Merged
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
24 changes: 13 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@ defaults:

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- appimage_arch: i686
runner: ubuntu-24.04
- appimage_arch: x86_64
runner: ubuntu-24.04
- appimage_arch: armhf
runner: ubuntu-24.04-arm
- appimage_arch: aarch64
runner: ubuntu-24.04-arm

runs-on: ${{ matrix.runner }}

steps:
- name: Checkout
Expand All @@ -42,9 +46,6 @@ jobs:
echo -n "https://github.com/${GITHUB_REPOSITORY}/commit/" > src/runtime/version
git rev-parse --short HEAD | xargs >> src/runtime/version

- name: Set up QEMU integration for Docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

- name: Build
env:
ARCH: ${{ matrix.appimage_arch }}
Expand All @@ -71,17 +72,20 @@ jobs:
path: out/*

build-in-chroot:
runs-on: ubuntu-latest
# if: false

strategy:
fail-fast: false
matrix:
include:
- alpine_arch: x86_64
- alpine_arch: x86
runner: ubuntu-24.04
- alpine_arch: x86_64
runner: ubuntu-24.04
- alpine_arch: armhf
runner: ubuntu-24.04-arm
- alpine_arch: aarch64
runner: ubuntu-24.04-arm

runs-on: ${{ matrix.runner }}

steps:
- name: Checkout
Expand All @@ -96,8 +100,6 @@ jobs:
env:
ALPINE_ARCH: ${{ matrix.alpine_arch }}
run: |
sudo apt-get update
sudo apt-get -y install qemu-user-static
scripts/chroot/chroot_build.sh

upload:
Expand Down
15 changes: 8 additions & 7 deletions scripts/chroot/chroot_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,18 @@ sudo cp -p /etc/resolv.conf miniroot/etc/
# build.sh combines existing scripts shared by all available build environments
sudo cp -R "$repo_root_dir"/scripts miniroot/scripts

if [ "$ALPINE_ARCH" = "x86" ] || [ "$ALPINE_ARCH" = "x86_64" ]; then
echo "Architecture is x86 or x86_64, hence not using qemu-arm-static"
if [ \
"$(uname -m)" = "${ALPINE_ARCH}" \
-o "${ALPINE_ARCH}" = "x86" -a "$(uname -m)" = "x86_64" \
-o "${ALPINE_ARCH}" = "armhf" -a "$(uname -m)" = "aarch64" \
]; then
sudo chroot miniroot /bin/sh -ex /scripts/chroot/build.sh
elif [ "$ALPINE_ARCH" = "aarch64" ] ; then
echo "Architecture is aarch64, hence using qemu-aarch64-static"
elif [ "${ALPINE_ARCH}" = "aarch64" ] ; then
sudo cp "$(which qemu-aarch64-static)" miniroot/usr/bin
sudo chroot miniroot qemu-aarch64-static /bin/sh -ex /scripts/chroot/build.sh
elif [ "$ALPINE_ARCH" = "armhf" ] ; then
echo "Architecture is armhf, hence using qemu-arm-static"
elif [ "${ALPINE_ARCH}" = "armhf" ] ; then
sudo cp "$(which qemu-arm-static)" miniroot/usr/bin
sudo cp "$repo_root_dir"/scripts/chroot/build.sh miniroot/build.sh && sudo chroot miniroot qemu-arm-static /bin/sh -ex /scripts/chroot/build.sh
sudo chroot miniroot qemu-arm-static /bin/sh -ex /scripts/chroot/build.sh
else
echo "Edit chroot_build.sh to support this architecture as well, it should be easy"
exit 1
Expand Down