From c867ef39a7b3d5ad80fbb12fada0b1b5b628934a Mon Sep 17 00:00:00 2001 From: Robert Sturla Date: Sun, 5 Jan 2025 15:55:31 +0000 Subject: [PATCH 1/2] feat: build both AMD64 and ARM64 --- .github/workflows/build_rechunk.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_rechunk.yml b/.github/workflows/build_rechunk.yml index 6f24ac2..47b31af 100644 --- a/.github/workflows/build_rechunk.yml +++ b/.github/workflows/build_rechunk.yml @@ -4,9 +4,9 @@ on: workflow_dispatch: inputs: tag: - description: 'The version to tag the package with:' + description: "The version to tag the package with:" required: true - + release: types: [published] @@ -25,10 +25,21 @@ jobs: steps: - name: Login to GHCR run: echo "${{ secrets.GITHUB_TOKEN }}" | sudo podman login ghcr.io -u ${{ github.actor }} --password-stdin - - uses: actions/checkout@v3 + + - uses: actions/checkout@v4 + + - name: Setup QEMU + run: | + sudo apt-get update + sudo apt-get install -y qemu-user-static + - name: Build Image run: | - sudo podman build --tag 'fedora_build' . + sudo podman build \ + --tag 'fedora_build' \ + --platform 'linux/amd64,linux/arm64' \ + . + - name: Upload Image id: upload shell: bash @@ -48,4 +59,3 @@ jobs: sudo podman push ghcr.io/hhd-dev/rechunk:stable sudo podman tag fedora_build ghcr.io/hhd-dev/rechunk:$VERSION sudo podman push ghcr.io/hhd-dev/rechunk:$VERSION - \ No newline at end of file From a8f4fafbe577cfea3c0b813249244272633ff73c Mon Sep 17 00:00:00 2001 From: Robert Sturla Date: Sun, 5 Jan 2025 16:02:44 +0000 Subject: [PATCH 2/2] chore: update the workflow to allow building images on PRs --- .github/workflows/build_rechunk.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_rechunk.yml b/.github/workflows/build_rechunk.yml index 47b31af..32cd64d 100644 --- a/.github/workflows/build_rechunk.yml +++ b/.github/workflows/build_rechunk.yml @@ -1,6 +1,10 @@ name: Publish rechunk to GHCR on: + pull_request: + paths: + - "./Dockerfile" + - "./.github/workflows/build_rechunk.yml" workflow_dispatch: inputs: tag: @@ -24,14 +28,13 @@ jobs: steps: - name: Login to GHCR + if: github.event_name == 'workflow_dispatch' || github.event_name == 'release' run: echo "${{ secrets.GITHUB_TOKEN }}" | sudo podman login ghcr.io -u ${{ github.actor }} --password-stdin - uses: actions/checkout@v4 - - name: Setup QEMU - run: | - sudo apt-get update - sudo apt-get install -y qemu-user-static + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Build Image run: | @@ -41,6 +44,7 @@ jobs: . - name: Upload Image + if: github.event_name == 'workflow_dispatch' || github.event_name == 'release' id: upload shell: bash run: |