From 1f0be177132ec7ef622fb5a8d681ac64a99ee6e8 Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Mon, 24 Feb 2025 13:15:38 -0700 Subject: [PATCH 1/9] ci: public arm64 docker image --- .github/workflows/publish.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 07caa619..83ee20f3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,6 +18,11 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: @@ -30,8 +35,10 @@ jobs: with: context: . target: hyperion-proxy - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 push: true + cache-from: type=gha + cache-to: type=gha,mode=max tags: | ghcr.io/${{ github.repository }}/hyperion-proxy:latest ghcr.io/${{ github.repository }}/hyperion-proxy:${{ github.sha }} @@ -41,8 +48,10 @@ jobs: with: context: . target: tag - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 push: true + cache-from: type=gha + cache-to: type=gha,mode=max tags: | ghcr.io/${{ github.repository }}/tag:latest ghcr.io/${{ github.repository }}/tag:${{ github.sha }} From 530d7b0f5844738a8d56759503e7323710bd8c31 Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Mon, 24 Feb 2025 13:27:47 -0700 Subject: [PATCH 2/9] separate runners --- .github/workflows/publish.yml | 62 ++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 83ee20f3..e0a0af40 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,8 +3,18 @@ on: push: branches: [main] jobs: - publish: - runs-on: ubuntu-latest + build: + strategy: + matrix: + arch: [amd64, arm64] + include: + - arch: amd64 + platform: linux/amd64 + runner: ubuntu-latest + - arch: arm64 + platform: linux/arm64 + runner: ubuntu-latest-arm64 + runs-on: ${{ matrix.runner }} permissions: contents: read id-token: write @@ -18,11 +28,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: @@ -35,26 +40,61 @@ jobs: with: context: . target: hyperion-proxy - platforms: linux/amd64,linux/arm64 + platforms: ${{ matrix.platform }} push: true cache-from: type=gha cache-to: type=gha,mode=max tags: | - ghcr.io/${{ github.repository }}/hyperion-proxy:latest - ghcr.io/${{ github.repository }}/hyperion-proxy:${{ github.sha }} + ghcr.io/${{ github.repository }}/hyperion-proxy:latest-${{ matrix.arch }} + ghcr.io/${{ github.repository }}/hyperion-proxy:${{ github.sha }}-${{ matrix.arch }} - name: Build and push tag uses: docker/build-push-action@v5 with: context: . target: tag - platforms: linux/amd64,linux/arm64 + platforms: ${{ matrix.platform }} push: true cache-from: type=gha cache-to: type=gha,mode=max + tags: | + ghcr.io/${{ github.repository }}/tag:latest-${{ matrix.arch }} + ghcr.io/${{ github.repository }}/tag:${{ github.sha }}-${{ matrix.arch }} + + manifest: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + packages: write + steps: + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create and push manifest for hyperion-proxy + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: | + ghcr.io/${{ github.repository }}/hyperion-proxy:latest + ghcr.io/${{ github.repository }}/hyperion-proxy:${{ github.sha }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/hyperion-proxy + + - name: Create and push manifest for tag + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64 tags: | ghcr.io/${{ github.repository }}/tag:latest ghcr.io/${{ github.repository }}/tag:${{ github.sha }} + outputs: type=image,name=ghcr.io/${{ github.repository }}/tag - name: Update test server env: From 2d01ee858e09c537efcbed64c83ea4eea1fecbb1 Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Mon, 24 Feb 2025 13:31:14 -0700 Subject: [PATCH 3/9] still build --- .github/workflows/publish.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e0a0af40..39f9dc46 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,7 +1,10 @@ -name: Publish +name: Build and Validate on: push: branches: [main] + pull_request: + branches: [main] + jobs: build: strategy: @@ -35,6 +38,18 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + # Set the Docker tags based on the event type + - name: Set Docker tags + id: docker-tags + run: | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + echo "HYPERION_PROXY_TAGS=ghcr.io/${{ github.repository }}/hyperion-proxy:pr-${{ github.event.pull_request.number }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT + echo "TAG_TAGS=ghcr.io/${{ github.repository }}/tag:pr-${{ github.event.pull_request.number }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT + else + echo "HYPERION_PROXY_TAGS=ghcr.io/${{ github.repository }}/hyperion-proxy:latest-${{ matrix.arch }},ghcr.io/${{ github.repository }}/hyperion-proxy:${{ github.sha }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT + echo "TAG_TAGS=ghcr.io/${{ github.repository }}/tag:latest-${{ matrix.arch }},ghcr.io/${{ github.repository }}/tag:${{ github.sha }}-${{ matrix.arch }}" >> $GITHUB_OUTPUT + fi + - name: Build and push hyperion-proxy uses: docker/build-push-action@v5 with: @@ -44,9 +59,7 @@ jobs: push: true cache-from: type=gha cache-to: type=gha,mode=max - tags: | - ghcr.io/${{ github.repository }}/hyperion-proxy:latest-${{ matrix.arch }} - ghcr.io/${{ github.repository }}/hyperion-proxy:${{ github.sha }}-${{ matrix.arch }} + tags: ${{ steps.docker-tags.outputs.HYPERION_PROXY_TAGS }} - name: Build and push tag uses: docker/build-push-action@v5 @@ -57,12 +70,12 @@ jobs: push: true cache-from: type=gha cache-to: type=gha,mode=max - tags: | - ghcr.io/${{ github.repository }}/tag:latest-${{ matrix.arch }} - ghcr.io/${{ github.repository }}/tag:${{ github.sha }}-${{ matrix.arch }} + tags: ${{ steps.docker-tags.outputs.TAG_TAGS }} manifest: needs: build + # Only run manifest job on pushes to main + if: github.event_name == 'push' runs-on: ubuntu-latest permissions: contents: read From a7329861efa1805e7bfc4019b523bda5c9537eaa Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Mon, 3 Mar 2025 17:49:32 -0800 Subject: [PATCH 4/9] change to abc lol --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 39f9dc46..97a568c0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: runner: ubuntu-latest - arch: arm64 platform: linux/arm64 - runner: ubuntu-latest-arm64 + runner: abc runs-on: ${{ matrix.runner }} permissions: contents: read From 93f63cb38e743861bc735cc613ad0d1228f90bcc Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Mon, 3 Mar 2025 17:57:18 -0800 Subject: [PATCH 5/9] Revert "change to abc lol" This reverts commit a7329861efa1805e7bfc4019b523bda5c9537eaa. --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 97a568c0..39f9dc46 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: runner: ubuntu-latest - arch: arm64 platform: linux/arm64 - runner: abc + runner: ubuntu-latest-arm64 runs-on: ${{ matrix.runner }} permissions: contents: read From 6d663750c2365c9c924bd1494164fe2774b98960 Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Mon, 3 Mar 2025 18:06:42 -0800 Subject: [PATCH 6/9] try another method --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 39f9dc46..f92459f7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: runner: ubuntu-latest - arch: arm64 platform: linux/arm64 - runner: ubuntu-latest-arm64 + runner: i-love-arm runs-on: ${{ matrix.runner }} permissions: contents: read From 4d37bebff60ea06bf81fcd31dd6270bde7dc10cb Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Tue, 4 Mar 2025 16:25:11 -0800 Subject: [PATCH 7/9] update --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f92459f7..5f4077e5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: - arch: amd64 platform: linux/amd64 runner: ubuntu-latest - - arch: arm64 + - arch: arm-hooray platform: linux/arm64 runner: i-love-arm runs-on: ${{ matrix.runner }} From 947c1b2ef206ce38e8f7b297e38e2061245ca25b Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Tue, 4 Mar 2025 16:32:23 -0800 Subject: [PATCH 8/9] udpate --- .github/workflows/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5f4077e5..1ff233f8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,9 +14,9 @@ jobs: - arch: amd64 platform: linux/amd64 runner: ubuntu-latest - - arch: arm-hooray + - arch: arm64 platform: linux/arm64 - runner: i-love-arm + runner: "i-love-arm" runs-on: ${{ matrix.runner }} permissions: contents: read From 550a986ebdac95e99e9eca1561ce8d9ce99efb3d Mon Sep 17 00:00:00 2001 From: Andrew Gazelka Date: Tue, 4 Mar 2025 16:45:26 -0800 Subject: [PATCH 9/9] add arm-hooray again --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1ff233f8..43eabb29 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: runner: ubuntu-latest - arch: arm64 platform: linux/arm64 - runner: "i-love-arm" + runner: arm-hooray runs-on: ${{ matrix.runner }} permissions: contents: read