From 61eb3ff90854fb1e06ec161755d00c7054564e60 Mon Sep 17 00:00:00 2001 From: Julien Neuhart Date: Thu, 9 Nov 2023 17:12:09 +0100 Subject: [PATCH] chore: add a dedicated GitHub action job to test armhf build, hoping for some upstream fix --- .github/workflows/continuous_integration.yml | 26 +++++++++++++++++++- scripts/release.sh | 21 ++++++++++++++-- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 60a1caac..f29bcf55 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -68,4 +68,28 @@ jobs: - name: Build and push Docker image for main branch run: | make release GOTENBERG_VERSION=edge - make release GOTENBERG_VERSION=edge DOCKER_REPOSITORY=thecodingmachine \ No newline at end of file + make release GOTENBERG_VERSION=edge DOCKER_REPOSITORY=thecodingmachine + + # FIXME: temporary job for checking if armhf build is working thanks to an upstream fix. + armhf_build: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + continue-on-error: true + needs: + - Tests + name: armhf build + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Checkout source code + uses: actions/checkout@v4 + - name: Log in to Docker Hub Container Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build try of armhf Docker image variant + run: | + make release GOTENBERG_VERSION=armmhf \ No newline at end of file diff --git a/scripts/release.sh b/scripts/release.sh index f884fe31..55fa153b 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -10,6 +10,25 @@ NOTO_COLOR_EMOJI_VERSION="$5" PDFTK_VERSION="$6" DOCKER_REPOSITORY="$7" +# FIXME: for whatever reasons, platform linux/arm/v7 (armhf) is not working +# anymore. See https://github.com/gotenberg/gotenberg/issues/709 for more +# details. + +if [ "$GOTENBERG_VERSION" == "armhf" ]; then + docker buildx build \ + --build-arg GOLANG_VERSION="$GOLANG_VERSION" \ + --build-arg GOTENBERG_VERSION="$GOTENBERG_VERSION" \ + --build-arg GOTENBERG_USER_GID="$GOTENBERG_USER_GID" \ + --build-arg GOTENBERG_USER_UID="$GOTENBERG_USER_UID" \ + --build-arg NOTO_COLOR_EMOJI_VERSION="$NOTO_COLOR_EMOJI_VERSION" \ + --build-arg PDFTK_VERSION="$PDFTK_VERSION" \ + --platform linux/arm/v7 \ + -t "$DOCKER_REPOSITORY/gotenberg:armhf" \ + -f build/Dockerfile . + + exit 0 +fi + if [ "$GOTENBERG_VERSION" == "edge" ]; then docker buildx build \ --build-arg GOLANG_VERSION="$GOLANG_VERSION" \ @@ -20,7 +39,6 @@ if [ "$GOTENBERG_VERSION" == "edge" ]; then --build-arg PDFTK_VERSION="$PDFTK_VERSION" \ --platform linux/amd64 \ --platform linux/arm64 \ - --platform linux/arm/v7 \ --platform linux/386 \ -t "$DOCKER_REPOSITORY/gotenberg:edge" \ --push \ @@ -57,7 +75,6 @@ docker buildx build \ --build-arg PDFTK_VERSION="$PDFTK_VERSION" \ --platform linux/amd64 \ --platform linux/arm64 \ - --platform linux/arm/v7 \ --platform linux/386 \ -t "$DOCKER_REPOSITORY/gotenberg:latest" \ -t "$DOCKER_REPOSITORY/gotenberg:${SEMVER[0]}" \