diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 701db4a..1be3574 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 @@ -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 }} @@ -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 @@ -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: diff --git a/scripts/chroot/chroot_build.sh b/scripts/chroot/chroot_build.sh index bdece77..1d0fedc 100755 --- a/scripts/chroot/chroot_build.sh +++ b/scripts/chroot/chroot_build.sh @@ -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