From f7afe70cbf8461f2f35e75126239cc57c65c7146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 20:59:16 -0600 Subject: [PATCH 001/125] wip --- .github/workflows/pull-request.yml | 142 +++++++++++++++++++++++++++-- 1 file changed, 133 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 3a19181..9c91abb 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -12,13 +12,137 @@ permissions: contents: read packages: write +env: + REGISTRY_IMAGE: ghcr.io/${{ github.repository }} + jobs: - pull-request: - uses: getdevopspro/github-actions/.github/workflows/pull-request.yml@v0.2.22 - secrets: - registry-password: ${{ secrets.GITHUB_TOKEN }} - with: - version-justfile: justfile - just-install: true - registry-username: ${{ github.actor }} - test-command: just unit-test system-test + prepare: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.platforms.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create matrix + id: platforms + run: | + echo "matrix=$(docker buildx bake image-all --print | jq -cr '.target."image-all".platforms')" >>${GITHUB_OUTPUT} + + - name: Show matrix + run: | + echo ${{ steps.platforms.outputs.matrix }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_IMAGE }} + + - name: Rename meta bake definition file + run: | + mv "${{ steps.meta.outputs.bake-file }}" "${{ runner.temp }}/bake-meta.json" + + - name: Upload meta bake definition + uses: actions/upload-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }}/bake-meta.json + if-no-files-found: error + retention-days: 1 + + build: + runs-on: ubuntu-latest + needs: + - prepare + strategy: + fail-fast: false + matrix: + platform: ${{ fromJson(needs.prepare.outputs.matrix) }} + steps: + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + + - name: Download meta bake definition + uses: actions/download-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build + id: bake + uses: docker/bake-action@v6 + with: + files: | + ./docker-bake.hcl + cwd://${{ runner.temp }}/bake-meta.json + targets: image + set: | + *.tags=${{ env.REGISTRY_IMAGE }} + *.platform=${{ matrix.platform }} + *.output=type=image,push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p ${{ runner.temp }}/digests + digest="${{ fromJSON(steps.bake.outputs.metadata).image['containerimage.digest'] }}" + touch "${{ runner.temp }}/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-${{ env.PLATFORM_PAIR }} + path: ${{ runner.temp }}/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-latest + needs: + - build + steps: + - name: Download meta bake definition + uses: actions/download-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }} + + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: ${{ runner.temp }}/digests + pattern: digests-* + merge-multiple: true + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Create manifest list and push + working-directory: ${{ runner.temp }}/digests + run: | + docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ env.REGISTRY_IMAGE }}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json) \ + $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' ${{ runner.temp }}/bake-meta.json) From c37e58287b537430660b5e29d3cebc242a658c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 21:13:52 -0600 Subject: [PATCH 002/125] wip --- .github/workflows/pull-request.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9c91abb..c951da6 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -14,10 +14,11 @@ permissions: env: REGISTRY_IMAGE: ghcr.io/${{ github.repository }} + BAKE_TARGET: build jobs: prepare: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 outputs: matrix: ${{ steps.platforms.outputs.matrix }} steps: @@ -27,7 +28,7 @@ jobs: - name: Create matrix id: platforms run: | - echo "matrix=$(docker buildx bake image-all --print | jq -cr '.target."image-all".platforms')" >>${GITHUB_OUTPUT} + echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr '.target."${{ env.BAKE_TARGET }}".platforms')" >>${GITHUB_OUTPUT} - name: Show matrix run: | @@ -52,7 +53,7 @@ jobs: retention-days: 1 build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: - prepare strategy: @@ -111,7 +112,7 @@ jobs: retention-days: 1 merge: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: - build steps: From 3f9eaddaef034b32c2d36d53c0fe816100a6d97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 21:21:32 -0600 Subject: [PATCH 003/125] wip --- .github/workflows/pull-request.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index c951da6..38abffd 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -15,10 +15,13 @@ permissions: env: REGISTRY_IMAGE: ghcr.io/${{ github.repository }} BAKE_TARGET: build + DOCKERHUB_USERNAME: ${{ github.actor }} + RUNNER_ARM64: ubuntu-22.04-arm + RUNNER_DEFAULT: ubuntu-22.04 jobs: prepare: - runs-on: ubuntu-22.04 + runs-on: ${{ env.RUNNER_DEFAULT }} outputs: matrix: ${{ steps.platforms.outputs.matrix }} steps: @@ -53,7 +56,7 @@ jobs: retention-days: 1 build: - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.platform == 'linux/arm64' && env.RUNNER_ARM64 || env.RUNNER_DEFAULT }} needs: - prepare strategy: @@ -76,7 +79,7 @@ jobs: uses: docker/login-action@v3 with: username: ${{ vars.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -112,7 +115,7 @@ jobs: retention-days: 1 merge: - runs-on: ubuntu-22.04 + runs-on: ${{ env.RUNNER_DEFAULT }} needs: - build steps: @@ -133,7 +136,7 @@ jobs: uses: docker/login-action@v3 with: username: ${{ vars.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From eb54b5726ddd9eb52f277529a2d0646c2e3aea9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 21:23:02 -0600 Subject: [PATCH 004/125] wip2 --- .github/workflows/pull-request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 38abffd..b8e5aef 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -21,7 +21,7 @@ env: jobs: prepare: - runs-on: ${{ env.RUNNER_DEFAULT }} + runs-on: ubuntu-22.04 outputs: matrix: ${{ steps.platforms.outputs.matrix }} steps: @@ -56,7 +56,7 @@ jobs: retention-days: 1 build: - runs-on: ${{ matrix.platform == 'linux/arm64' && env.RUNNER_ARM64 || env.RUNNER_DEFAULT }} + runs-on: ${{ matrix.platform == 'linux/arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} needs: - prepare strategy: @@ -115,7 +115,7 @@ jobs: retention-days: 1 merge: - runs-on: ${{ env.RUNNER_DEFAULT }} + runs-on: ubuntu-22.04 needs: - build steps: From a8a9e74da2743e836a42ec850d8adf8776b1c1e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 21:26:57 -0600 Subject: [PATCH 005/125] wip --- .github/workflows/pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index b8e5aef..8c38c44 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -78,7 +78,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: - username: ${{ vars.DOCKERHUB_USERNAME }} + username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU @@ -135,7 +135,7 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v3 with: - username: ${{ vars.DOCKERHUB_USERNAME }} + username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx From 5604711b0777049516ebb8118ca61ff8ff7802c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 21:29:01 -0600 Subject: [PATCH 006/125] wip --- .github/workflows/pull-request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8c38c44..4c3e06a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -18,6 +18,7 @@ env: DOCKERHUB_USERNAME: ${{ github.actor }} RUNNER_ARM64: ubuntu-22.04-arm RUNNER_DEFAULT: ubuntu-22.04 + registry: ghcr.io jobs: prepare: @@ -78,6 +79,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: + registry: ${{ env.REGISTRY_IMAGE }} username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ secrets.GITHUB_TOKEN }} @@ -135,6 +137,7 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v3 with: + registry: ${{ env.REGISTRY_IMAGE }} username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ secrets.GITHUB_TOKEN }} From f3de0b79b63a55771b2b887610e13fe086f2d840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 22:11:08 -0600 Subject: [PATCH 007/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4c3e06a..450d6c2 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -96,7 +96,7 @@ jobs: files: | ./docker-bake.hcl cwd://${{ runner.temp }}/bake-meta.json - targets: image + targets: ${{ env.BAKE_TARGET }} set: | *.tags=${{ env.REGISTRY_IMAGE }} *.platform=${{ matrix.platform }} From e3a5c005dfd66ad25ae99308d314bbf143925cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 22:23:46 -0600 Subject: [PATCH 008/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 450d6c2..46d46f2 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -105,7 +105,7 @@ jobs: - name: Export digest run: | mkdir -p ${{ runner.temp }}/digests - digest="${{ fromJSON(steps.bake.outputs.metadata).image['containerimage.digest'] }}" + digest="${{ fromJSON(steps.bake.outputs.metadata).containerimage.digest }}" touch "${{ runner.temp }}/digests/${digest#sha256:}" - name: Upload digest From 8d072699270707caa5b778c27346671a9b7d21a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 22:31:15 -0600 Subject: [PATCH 009/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 46d46f2..870bd4e 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -105,7 +105,7 @@ jobs: - name: Export digest run: | mkdir -p ${{ runner.temp }}/digests - digest="${{ fromJSON(steps.bake.outputs.metadata).containerimage.digest }}" + digest="${{ fromJSON(steps.bake.outputs.metadata)['containerimage.digest'] }}" touch "${{ runner.temp }}/digests/${digest#sha256:}" - name: Upload digest From 562a72ebf37daa873955fc71e75871e1785bbcf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 22:39:56 -0600 Subject: [PATCH 010/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 870bd4e..19200af 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -105,7 +105,7 @@ jobs: - name: Export digest run: | mkdir -p ${{ runner.temp }}/digests - digest="${{ fromJSON(steps.bake.outputs.metadata)['containerimage.digest'] }}" + digest=$(echo '${{ steps.bake.outputs.metadata }}' | jq -r ".${{ env.BAKE_TARGET }}.\"containerimage.digest\"") touch "${{ runner.temp }}/digests/${digest#sha256:}" - name: Upload digest From dd3877f8618dfdd22e7abc97150e96a3626ee8b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 23:27:12 -0600 Subject: [PATCH 011/125] wip --- Dockerfile | 8 +++++- docker-bake.hcl | 76 +++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 81 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7dcb5af..b9848e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,9 @@ -FROM busybox +FROM busybox as base RUN touch $(date +%Y-%m-%d-%H:%M:%S).txt + +FROM base as app1 + +FROM base as app2 + +FROM base as app3 diff --git a/docker-bake.hcl b/docker-bake.hcl index b396ae4..b2a7fcc 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,8 +1,36 @@ // docker-bake.hcl +variable "GITHUB_REPOSITORY_OWNER" { + default = "getdevopspro" +} + +variable "GITHUB_REPOSITORY" { + default = "getdevopspro/multiarch-test" +} + +variable "APP1_IMAGE_NAME" { + default = "ghcr.io/${lower(GITHUB_REPOSITORY_OWNER)}/app1" +} + +variable "APP2_IMAGE_NAME" { + default = "ghcr.io/${lower(GITHUB_REPOSITORY_OWNER)}/app2" +} + +function "generate_tags" { + params = [image, tags] + result = formatlist("%s:%s", image, tags) +} + +group "build" { + targets = ["build-app1", "build-app2"] + platforms = [ + // "linux/amd64", + "linux/arm64", + ] +} + target "docker-metadata-action" {} -target "build" { - inherits = ["docker-metadata-action"] +target "build-base" { context = "./" dockerfile = "Dockerfile" platforms = [ @@ -10,3 +38,47 @@ target "build" { "linux/arm64", ] } + +target "build-app1" { + inherits = ["build-base"] + target = "app1" + tags = concat( + generate_tags(APP1_IMAGE_NAME, coalesce(target.docker-metadata-action.tags, ["dev"])), + ) + labels = merge( + target.docker-metadata-action.labels, + { + "org.opencontainers.image.description" = "Multi-architecture application 1", + "org.opencontainers.image.title" = "Multi-arch App 1", + }, + ) + annotations = concat( + coalesce(target.docker-metadata-action.annotations, []), + [ + "manifest:org.opencontainers.image.description=Multi-architecture application 1", + "manifest:org.opencontainers.image.title=Multi-arch App 1", + ] + ) +} + +target "build-app2" { + inherits = ["build-base"] + target = "app2" + tags = concat( + generate_tags(APP2_IMAGE_NAME, coalesce(target.docker-metadata-action.tags, ["dev"])), + ) + labels = merge( + target.docker-metadata-action.labels, + { + "org.opencontainers.image.description" = "Multi-architecture application 2", + "org.opencontainers.image.title" = "Multi-arch App 2", + }, + ) + annotations = concat( + coalesce(target.docker-metadata-action.annotations, []), + [ + "manifest:org.opencontainers.image.description=Multi-architecture application 2", + "manifest:org.opencontainers.image.title=Multi-arch App 2", + ] + ) +} From fd3717537750aac9f7ab0e672ca0dc8731bd1f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sat, 26 Jul 2025 23:30:56 -0600 Subject: [PATCH 012/125] wip --- docker-bake.hcl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index b2a7fcc..54ad8a4 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -22,10 +22,6 @@ function "generate_tags" { group "build" { targets = ["build-app1", "build-app2"] - platforms = [ - // "linux/amd64", - "linux/arm64", - ] } target "docker-metadata-action" {} From c0d27e096cf1beeeb6d7b067a3e779996cde6bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 00:19:25 -0600 Subject: [PATCH 013/125] wip --- .github/workflows/pull-request.yml | 18 +++++++++++++----- docker-bake.hcl | 10 ++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 19200af..7171851 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -13,12 +13,13 @@ permissions: packages: write env: - REGISTRY_IMAGE: ghcr.io/${{ github.repository }} + # REGISTRY_IMAGE: ghcr.io/${{ github.repository }} + REGISTRY_IMAGE: '' BAKE_TARGET: build DOCKERHUB_USERNAME: ${{ github.actor }} RUNNER_ARM64: ubuntu-22.04-arm RUNNER_DEFAULT: ubuntu-22.04 - registry: ghcr.io + REGISTRY: ghcr.io jobs: prepare: @@ -32,7 +33,14 @@ jobs: - name: Create matrix id: platforms run: | - echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr '.target."${{ env.BAKE_TARGET }}".platforms')" >>${GITHUB_OUTPUT} + echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr ' + .target + | to_entries + | map({ + image: .key, + platforms: .value.platforms + }) + ')" >> $GITHUB_OUTPUT - name: Show matrix run: | @@ -79,7 +87,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY_IMAGE }} + registry: ${{ env.REGISTRY }} username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ secrets.GITHUB_TOKEN }} @@ -137,7 +145,7 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY_IMAGE }} + registry: ${{ env.REGISTRY }} username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ secrets.GITHUB_TOKEN }} diff --git a/docker-bake.hcl b/docker-bake.hcl index 54ad8a4..ba1f6e6 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -24,6 +24,16 @@ group "build" { targets = ["build-app1", "build-app2"] } +group "build-arm64" { + targets = ["build-app1", "build-app2"] + platforms = ["linux/arm64"] +} + +group "build-amd64" { + targets = ["build-app1", "build-app2"] + platforms = ["linux/amd64"] +} + target "docker-metadata-action" {} target "build-base" { From 74934cfe278d3933700df836c8841554d9d5aeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 00:24:54 -0600 Subject: [PATCH 014/125] wip --- .github/workflows/pull-request.yml | 3 +-- docker-bake.hcl | 10 ---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 7171851..9ce0c15 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -70,8 +70,7 @@ jobs: - prepare strategy: fail-fast: false - matrix: - platform: ${{ fromJson(needs.prepare.outputs.matrix) }} + matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - name: Prepare run: | diff --git a/docker-bake.hcl b/docker-bake.hcl index ba1f6e6..54ad8a4 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -24,16 +24,6 @@ group "build" { targets = ["build-app1", "build-app2"] } -group "build-arm64" { - targets = ["build-app1", "build-app2"] - platforms = ["linux/arm64"] -} - -group "build-amd64" { - targets = ["build-app1", "build-app2"] - platforms = ["linux/amd64"] -} - target "docker-metadata-action" {} target "build-base" { From f5751eb0bf3e5bc00b936390c637c742352137ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 00:36:26 -0600 Subject: [PATCH 015/125] wip --- .github/workflows/pull-request.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9ce0c15..5547926 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -38,7 +38,7 @@ jobs: | to_entries | map({ image: .key, - platforms: .value.platforms + platform: .value.platforms }) ')" >> $GITHUB_OUTPUT @@ -70,7 +70,8 @@ jobs: - prepare strategy: fail-fast: false - matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} + matrix: + include: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - name: Prepare run: | From 8b731694657ffa0cd5f0c2bf5535a5d7f7cd3ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 00:38:09 -0600 Subject: [PATCH 016/125] wip --- .github/workflows/pull-request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 5547926..933066d 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -70,8 +70,7 @@ jobs: - prepare strategy: fail-fast: false - matrix: - include: ${{ fromJson(needs.prepare.outputs.matrix) }} + matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - name: Prepare run: | From 4e2aa8c1d9821e96ed74656492f2223033d4325c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 00:43:12 -0600 Subject: [PATCH 017/125] wip --- .github/workflows/pull-request.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 933066d..446dbf4 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -36,10 +36,8 @@ jobs: echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr ' .target | to_entries - | map({ - image: .key, - platform: .value.platforms - }) + | map({ key: .key, value: { platform: .value.platforms } }) + | from_entries ')" >> $GITHUB_OUTPUT - name: Show matrix From 2de75d104b1200bb5c0ff7d3d3bd693cfe3bb161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 00:53:09 -0600 Subject: [PATCH 018/125] wip --- .github/workflows/pull-request.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 446dbf4..c0da733 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -33,11 +33,12 @@ jobs: - name: Create matrix id: platforms run: | - echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr ' + echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -r ' .target - | to_entries - | map({ key: .key, value: { platform: .value.platforms } }) - | from_entries + | to_entries[] + | . as $target + | $target.value.platforms[] + | "\($target.key)-\(. | split("/")[1])\n image: \($target.key)\n platform: \(. )" ')" >> $GITHUB_OUTPUT - name: Show matrix From 399fb360e8c104e220c6ede6cc950c0ab8826e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 00:54:25 -0600 Subject: [PATCH 019/125] wip --- .github/workflows/pull-request.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index c0da733..4254d03 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -33,12 +33,13 @@ jobs: - name: Create matrix id: platforms run: | - echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -r ' + echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr ' .target - | to_entries[] - | . as $target - | $target.value.platforms[] - | "\($target.key)-\(. | split("/")[1])\n image: \($target.key)\n platform: \(. )" + | to_entries + | map( + .value.platforms[] + | { image: . as $platform | ($platform | split("/") | join("-")) | "\(input_filename)-\(.)" }? + ) ')" >> $GITHUB_OUTPUT - name: Show matrix From 82208f881390842074a4a6d45a9ba15730881ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 00:59:18 -0600 Subject: [PATCH 020/125] wip --- .github/workflows/pull-request.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4254d03..21d6c9f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -37,8 +37,13 @@ jobs: .target | to_entries | map( - .value.platforms[] - | { image: . as $platform | ($platform | split("/") | join("-")) | "\(input_filename)-\(.)" }? + . as $t + | $t.value.platforms[] + | { + name: ($t.key + "-" + (split("/")[0] + "-" + split("/")[1])), + image: $t.key, + platform: . + } ) ')" >> $GITHUB_OUTPUT From 56b4d5356c303899c4fe22f584ff6e249abbf268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 01:02:48 -0600 Subject: [PATCH 021/125] wip --- .github/workflows/pull-request.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 21d6c9f..cfe6a6d 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -34,17 +34,18 @@ jobs: id: platforms run: | echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr ' - .target - | to_entries - | map( - . as $t - | $t.value.platforms[] - | { - name: ($t.key + "-" + (split("/")[0] + "-" + split("/")[1])), - image: $t.key, - platform: . - } - ) + .target as $targets | + [ + $targets | to_entries[] | + . as $t | + $t.value.platforms[] | + { + ( ($t.key + "-" + (. | gsub("/"; "-"))) ): { + image: $t.key, + platform: . + } + } + ] | add ')" >> $GITHUB_OUTPUT - name: Show matrix From a0328a7191e3579392d2a74c5dd9075e36ba3377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 01:05:47 -0600 Subject: [PATCH 022/125] wip --- .github/workflows/pull-request.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index cfe6a6d..f59abff 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -34,17 +34,8 @@ jobs: id: platforms run: | echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr ' - .target as $targets | - [ - $targets | to_entries[] | - . as $t | - $t.value.platforms[] | - { - ( ($t.key + "-" + (. | gsub("/"; "-"))) ): { - image: $t.key, - platform: . - } - } + [ .target | to_entries[] as $t | $t.value.platforms[] | + { "\($t.key)-\(gsub("/"; "-"))": { image: $t.key, platform: . } } ] | add ')" >> $GITHUB_OUTPUT @@ -71,16 +62,17 @@ jobs: retention-days: 1 build: - runs-on: ${{ matrix.platform == 'linux/arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} + runs-on: ${{ matrix.image-platform.platform == 'linux/arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} needs: - prepare strategy: fail-fast: false - matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} + matrix: + image-platform: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - name: Prepare run: | - platform=${{ matrix.platform }} + platform=${{ matrix.image-platform.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Download meta bake definition @@ -112,7 +104,7 @@ jobs: targets: ${{ env.BAKE_TARGET }} set: | *.tags=${{ env.REGISTRY_IMAGE }} - *.platform=${{ matrix.platform }} + *.platform=${{ matrix.image-platform.platform }} *.output=type=image,push-by-digest=true,name-canonical=true,push=true - name: Export digest From bb7a674ed24c59fe6e6633faa6c1b57e4c71def7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 01:07:39 -0600 Subject: [PATCH 023/125] wip --- .github/workflows/pull-request.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f59abff..f12754e 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -62,17 +62,17 @@ jobs: retention-days: 1 build: - runs-on: ${{ matrix.image-platform.platform == 'linux/arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} + runs-on: ${{ matrix.imageplatform.platform == 'linux/arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} needs: - prepare strategy: fail-fast: false matrix: - image-platform: ${{ fromJson(needs.prepare.outputs.matrix) }} + imageplatform: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - name: Prepare run: | - platform=${{ matrix.image-platform.platform }} + platform=${{ matrix.imageplatform.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Download meta bake definition @@ -104,7 +104,7 @@ jobs: targets: ${{ env.BAKE_TARGET }} set: | *.tags=${{ env.REGISTRY_IMAGE }} - *.platform=${{ matrix.image-platform.platform }} + *.platform=${{ matrix.imageplatform.platform }} *.output=type=image,push-by-digest=true,name-canonical=true,push=true - name: Export digest From 9e879e0a67423a91a4370cc267bacd36141cb02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 01:16:36 -0600 Subject: [PATCH 024/125] wip --- .github/workflows/pull-request.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f12754e..0c15c91 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -33,11 +33,7 @@ jobs: - name: Create matrix id: platforms run: | - echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr ' - [ .target | to_entries[] as $t | $t.value.platforms[] | - { "\($t.key)-\(gsub("/"; "-"))": { image: $t.key, platform: . } } - ] | add - ')" >> $GITHUB_OUTPUT + echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr '[.target | to_entries[] as $t | $t.value.platforms[] | {name: $t.key, platform: .}]')" >> $GITHUB_OUTPUT - name: Show matrix run: | @@ -62,17 +58,17 @@ jobs: retention-days: 1 build: - runs-on: ${{ matrix.imageplatform.platform == 'linux/arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} + runs-on: ${{ matrix.image.platform == 'linux/arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} needs: - prepare strategy: fail-fast: false matrix: - imageplatform: ${{ fromJson(needs.prepare.outputs.matrix) }} + image: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - name: Prepare run: | - platform=${{ matrix.imageplatform.platform }} + platform=${{ matrix.image.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Download meta bake definition @@ -104,7 +100,7 @@ jobs: targets: ${{ env.BAKE_TARGET }} set: | *.tags=${{ env.REGISTRY_IMAGE }} - *.platform=${{ matrix.imageplatform.platform }} + *.platform=${{ matrix.image.platform }} *.output=type=image,push-by-digest=true,name-canonical=true,push=true - name: Export digest From b0ecbcab03e07f6a5226b388412f67a9f07d748b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 01:33:52 -0600 Subject: [PATCH 025/125] wip --- .github/workflows/pull-request.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0c15c91..d805e65 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -33,7 +33,7 @@ jobs: - name: Create matrix id: platforms run: | - echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr '[.target | to_entries[] as $t | $t.value.platforms[] | {name: $t.key, platform: .}]')" >> $GITHUB_OUTPUT + echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr '.target | to_entries | map(.value.platforms[]) | unique')" >>${GITHUB_OUTPUT} - name: Show matrix run: | @@ -58,17 +58,17 @@ jobs: retention-days: 1 build: - runs-on: ${{ matrix.image.platform == 'linux/arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} + runs-on: ${{ matrix.platform == 'linux/arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} needs: - prepare strategy: fail-fast: false matrix: - image: ${{ fromJson(needs.prepare.outputs.matrix) }} + platform: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - name: Prepare run: | - platform=${{ matrix.image.platform }} + platform=${{ matrix.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Download meta bake definition @@ -100,7 +100,7 @@ jobs: targets: ${{ env.BAKE_TARGET }} set: | *.tags=${{ env.REGISTRY_IMAGE }} - *.platform=${{ matrix.image.platform }} + *.platform=${{ matrix.platform }} *.output=type=image,push-by-digest=true,name-canonical=true,push=true - name: Export digest From 25b08e378bdbce48d508f6e96e5616930cc4caf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 01:43:11 -0600 Subject: [PATCH 026/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index d805e65..afa4e4e 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -99,7 +99,7 @@ jobs: cwd://${{ runner.temp }}/bake-meta.json targets: ${{ env.BAKE_TARGET }} set: | - *.tags=${{ env.REGISTRY_IMAGE }} + {{ env.REGISTRY_IMAGE != '' && '*.tags=' + env.REGISTRY_IMAGE }} *.platform=${{ matrix.platform }} *.output=type=image,push-by-digest=true,name-canonical=true,push=true From 382b4ef442aeefc6cff506abd711f6f39c01991f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 01:44:22 -0600 Subject: [PATCH 027/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index afa4e4e..b0e4942 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -99,7 +99,7 @@ jobs: cwd://${{ runner.temp }}/bake-meta.json targets: ${{ env.BAKE_TARGET }} set: | - {{ env.REGISTRY_IMAGE != '' && '*.tags=' + env.REGISTRY_IMAGE }} + ${{ env.REGISTRY_IMAGE != '' && '*.tags=' + env.REGISTRY_IMAGE }} *.platform=${{ matrix.platform }} *.output=type=image,push-by-digest=true,name-canonical=true,push=true From 31ce89761c2434b4403d6160668fd65c437b5f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 01:45:03 -0600 Subject: [PATCH 028/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index b0e4942..665f300 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -99,7 +99,7 @@ jobs: cwd://${{ runner.temp }}/bake-meta.json targets: ${{ env.BAKE_TARGET }} set: | - ${{ env.REGISTRY_IMAGE != '' && '*.tags=' + env.REGISTRY_IMAGE }} + ${{ env.REGISTRY_IMAGE != '' && '*.tags=' . env.REGISTRY_IMAGE }} *.platform=${{ matrix.platform }} *.output=type=image,push-by-digest=true,name-canonical=true,push=true From 7a4a5ceef153d5d23c9f408d368953f50340b482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 01:46:58 -0600 Subject: [PATCH 029/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 665f300..6185adc 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -99,7 +99,7 @@ jobs: cwd://${{ runner.temp }}/bake-meta.json targets: ${{ env.BAKE_TARGET }} set: | - ${{ env.REGISTRY_IMAGE != '' && '*.tags=' . env.REGISTRY_IMAGE }} + ${{ env.REGISTRY_IMAGE != '' && format('*.tags={0}', env.REGISTRY_IMAGE) || '' }} *.platform=${{ matrix.platform }} *.output=type=image,push-by-digest=true,name-canonical=true,push=true From 92d6e9e68746d7434c46de6e5ad8ebbed39c8052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 02:05:26 -0600 Subject: [PATCH 030/125] wip --- .github/workflows/pull-request.yml | 2 ++ docker-bake.hcl | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6185adc..e9b7a85 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -93,6 +93,8 @@ jobs: - name: Build id: bake uses: docker/bake-action@v6 + env: + NO_TAG: true with: files: | ./docker-bake.hcl diff --git a/docker-bake.hcl b/docker-bake.hcl index 54ad8a4..1c29d96 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -15,9 +15,13 @@ variable "APP2_IMAGE_NAME" { default = "ghcr.io/${lower(GITHUB_REPOSITORY_OWNER)}/app2" } +variable "NO_TAG" { + default = false +} + function "generate_tags" { params = [image, tags] - result = formatlist("%s:%s", image, tags) + result = NO_TAG ? [image] : formatlist("%s:%s", image, tags) } group "build" { From 4b69ee62c639e5ecbf05e3d9af313151bdacfc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 02:21:40 -0600 Subject: [PATCH 031/125] wip --- .github/workflows/pull-request.yml | 6 ++++-- docker-bake.hcl | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index e9b7a85..f8e1f74 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -77,6 +77,10 @@ jobs: name: bake-meta path: ${{ runner.temp }} + - name: Do not use tags in bake meta for this step + run: | + jq '.target |= with_entries(.value.tags |= map(sub(":.*$"; "")))' < ${{ runner.temp }}/bake-meta.json > ${{ runner.temp }}/bake-meta.json + - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -93,8 +97,6 @@ jobs: - name: Build id: bake uses: docker/bake-action@v6 - env: - NO_TAG: true with: files: | ./docker-bake.hcl diff --git a/docker-bake.hcl b/docker-bake.hcl index 1c29d96..54ad8a4 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -15,13 +15,9 @@ variable "APP2_IMAGE_NAME" { default = "ghcr.io/${lower(GITHUB_REPOSITORY_OWNER)}/app2" } -variable "NO_TAG" { - default = false -} - function "generate_tags" { params = [image, tags] - result = NO_TAG ? [image] : formatlist("%s:%s", image, tags) + result = formatlist("%s:%s", image, tags) } group "build" { From b39b87bfd44278e7e398ab7f9b5c35b9707ad2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 02:22:17 -0600 Subject: [PATCH 032/125] wip --- .github/workflows/pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f8e1f74..edec873 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -79,7 +79,7 @@ jobs: - name: Do not use tags in bake meta for this step run: | - jq '.target |= with_entries(.value.tags |= map(sub(":.*$"; "")))' < ${{ runner.temp }}/bake-meta.json > ${{ runner.temp }}/bake-meta.json + jq '.target |= with_entries(.value.tags |= map(sub(":.*$"; "")))' < ${{ runner.temp }}/bake-meta.json > ${{ runner.temp }}/bake-meta-no-tag.json - name: Login to Docker Hub uses: docker/login-action@v3 @@ -100,7 +100,7 @@ jobs: with: files: | ./docker-bake.hcl - cwd://${{ runner.temp }}/bake-meta.json + cwd://${{ runner.temp }}/bake-meta-no-tag.json targets: ${{ env.BAKE_TARGET }} set: | ${{ env.REGISTRY_IMAGE != '' && format('*.tags={0}', env.REGISTRY_IMAGE) || '' }} From 34b933124eb58fd5a95174c15f7c8ac4cf9e31fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 02:23:18 -0600 Subject: [PATCH 033/125] wip --- .github/workflows/pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index edec873..90285f8 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -80,6 +80,7 @@ jobs: - name: Do not use tags in bake meta for this step run: | jq '.target |= with_entries(.value.tags |= map(sub(":.*$"; "")))' < ${{ runner.temp }}/bake-meta.json > ${{ runner.temp }}/bake-meta-no-tag.json + cat ${{ runner.temp }}/bake-meta-no-tag.json - name: Login to Docker Hub uses: docker/login-action@v3 From db1624f1c8c07c28360d31973f22f2c6d3acd631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 02:25:22 -0600 Subject: [PATCH 034/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 90285f8..39674c0 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -79,7 +79,7 @@ jobs: - name: Do not use tags in bake meta for this step run: | - jq '.target |= with_entries(.value.tags |= map(sub(":.*$"; "")))' < ${{ runner.temp }}/bake-meta.json > ${{ runner.temp }}/bake-meta-no-tag.json + jq 'del(.target."docker-metadata-action".tags)' ${{ runner.temp }}/bake-meta.json > ${{ runner.temp }}/bake-meta-no-tag.json cat ${{ runner.temp }}/bake-meta-no-tag.json - name: Login to Docker Hub From dfe31f4d9bdf43a2a53b62a7cb6f4857d23a7234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 02:30:11 -0600 Subject: [PATCH 035/125] wip --- .github/workflows/pull-request.yml | 9 +++------ docker-bake.hcl | 6 +++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 39674c0..e9b7a85 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -77,11 +77,6 @@ jobs: name: bake-meta path: ${{ runner.temp }} - - name: Do not use tags in bake meta for this step - run: | - jq 'del(.target."docker-metadata-action".tags)' ${{ runner.temp }}/bake-meta.json > ${{ runner.temp }}/bake-meta-no-tag.json - cat ${{ runner.temp }}/bake-meta-no-tag.json - - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -98,10 +93,12 @@ jobs: - name: Build id: bake uses: docker/bake-action@v6 + env: + NO_TAG: true with: files: | ./docker-bake.hcl - cwd://${{ runner.temp }}/bake-meta-no-tag.json + cwd://${{ runner.temp }}/bake-meta.json targets: ${{ env.BAKE_TARGET }} set: | ${{ env.REGISTRY_IMAGE != '' && format('*.tags={0}', env.REGISTRY_IMAGE) || '' }} diff --git a/docker-bake.hcl b/docker-bake.hcl index 54ad8a4..1c29d96 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -15,9 +15,13 @@ variable "APP2_IMAGE_NAME" { default = "ghcr.io/${lower(GITHUB_REPOSITORY_OWNER)}/app2" } +variable "NO_TAG" { + default = false +} + function "generate_tags" { params = [image, tags] - result = formatlist("%s:%s", image, tags) + result = NO_TAG ? [image] : formatlist("%s:%s", image, tags) } group "build" { From 38056a486e48edbb699c9e85300a799f12a26bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 02:42:18 -0600 Subject: [PATCH 036/125] wip --- .github/workflows/pull-request.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index e9b7a85..39f40b4 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -110,6 +110,8 @@ jobs: mkdir -p ${{ runner.temp }}/digests digest=$(echo '${{ steps.bake.outputs.metadata }}' | jq -r ".${{ env.BAKE_TARGET }}.\"containerimage.digest\"") touch "${{ runner.temp }}/digests/${digest#sha256:}" + cat "${{ runner.temp }}/digests/${digest#sha256:}" + ls -al ${{ runner.temp }}/digests - name: Upload digest uses: actions/upload-artifact@v4 From eebd94b654c24f6926154faf8ee625f9f142310b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 03:07:31 -0600 Subject: [PATCH 037/125] wip --- .github/workflows/pull-request.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 39f40b4..1c760d4 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -105,11 +105,13 @@ jobs: *.platform=${{ matrix.platform }} *.output=type=image,push-by-digest=true,name-canonical=true,push=true - - name: Export digest + - name: Export container digests run: | - mkdir -p ${{ runner.temp }}/digests - digest=$(echo '${{ steps.bake.outputs.metadata }}' | jq -r ".${{ env.BAKE_TARGET }}.\"containerimage.digest\"") - touch "${{ runner.temp }}/digests/${digest#sha256:}" + echo '${{ steps.bake.outputs.metadata }}' \ + | jq -r 'to_entries[] + | select(.value["containerimage.digest"]) + | "\(.key)/\(.value["containerimage.digest"]|sub("^sha256:";""))" + ' | xargs -I{} sh -c 'mkdir -p "${1%/*}" && touch "${1}"' _ {} cat "${{ runner.temp }}/digests/${digest#sha256:}" ls -al ${{ runner.temp }}/digests From 2915ec64110ccf6664725e92d7f691b062431c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 03:09:41 -0600 Subject: [PATCH 038/125] wip --- .github/workflows/pull-request.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1c760d4..b96c1ed 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -108,10 +108,8 @@ jobs: - name: Export container digests run: | echo '${{ steps.bake.outputs.metadata }}' \ - | jq -r 'to_entries[] - | select(.value["containerimage.digest"]) - | "\(.key)/\(.value["containerimage.digest"]|sub("^sha256:";""))" - ' | xargs -I{} sh -c 'mkdir -p "${1%/*}" && touch "${1}"' _ {} + | jq -r 'to_entries[]|select(.value["containerimage.digest"])|"\(.key)/\(.value["containerimage.digest"]|sub("^sha256:";""))"' + | xargs -I{} sh -c 'mkdir -p "$RUNNER_TEMP/digests/${1%/*}" && touch "$RUNNER_TEMP/digests/${1}"' _ {} cat "${{ runner.temp }}/digests/${digest#sha256:}" ls -al ${{ runner.temp }}/digests From 2a859540b3d7453d33cf30b3b590b906dcff1961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 03:12:11 -0600 Subject: [PATCH 039/125] wip --- .github/workflows/pull-request.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index b96c1ed..1627596 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -106,12 +106,14 @@ jobs: *.output=type=image,push-by-digest=true,name-canonical=true,push=true - name: Export container digests + working-directory: ${{ runner.temp }} run: | + mkdir -p digests echo '${{ steps.bake.outputs.metadata }}' \ | jq -r 'to_entries[]|select(.value["containerimage.digest"])|"\(.key)/\(.value["containerimage.digest"]|sub("^sha256:";""))"' - | xargs -I{} sh -c 'mkdir -p "$RUNNER_TEMP/digests/${1%/*}" && touch "$RUNNER_TEMP/digests/${1}"' _ {} - cat "${{ runner.temp }}/digests/${digest#sha256:}" - ls -al ${{ runner.temp }}/digests + | xargs -I{} sh -c 'mkdir -p "digests/${1%/*}" && touch "digests/${1}"' _ {} + cat digests/* + ls -al /digests - name: Upload digest uses: actions/upload-artifact@v4 From a0637f730ce4b773374eb90ec0e29442e196a155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 04:44:03 -0600 Subject: [PATCH 040/125] wip --- .github/workflows/pull-request.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1627596..4fffa90 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -106,14 +106,9 @@ jobs: *.output=type=image,push-by-digest=true,name-canonical=true,push=true - name: Export container digests - working-directory: ${{ runner.temp }} run: | - mkdir -p digests - echo '${{ steps.bake.outputs.metadata }}' \ - | jq -r 'to_entries[]|select(.value["containerimage.digest"])|"\(.key)/\(.value["containerimage.digest"]|sub("^sha256:";""))"' - | xargs -I{} sh -c 'mkdir -p "digests/${1%/*}" && touch "digests/${1}"' _ {} - cat digests/* - ls -al /digests + mkdir -p ${{ runner.temp }}/digests + echo '${{ steps.bake.outputs.metadata }}' | jq 'with_entries(select(.key | startswith("build-"))) | map_values({name: ."image.name", digests: [."containerimage.digest"]})' > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json - name: Upload digest uses: actions/upload-artifact@v4 @@ -154,8 +149,15 @@ jobs: - name: Create manifest list and push working-directory: ${{ runner.temp }}/digests run: | - docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${{ env.REGISTRY_IMAGE }}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json) \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + jq -s 'add' ${{ runner.temp }}/digests/*.json > ${{ runner.temp }}/all.json + JSON_FILE=${{ runner.temp }}/all.json + for key in $(jq -r 'keys[]' "$JSON_FILE"); do + image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") + done + docker buildx imagetools create \ + $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json) \ + $(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) + done - name: Inspect image run: | From 2c7a2b5f156fb3376f778d5890520fc4a4be96b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 04:47:50 -0600 Subject: [PATCH 041/125] wip --- .github/workflows/pull-request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4fffa90..96717be 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -150,10 +150,11 @@ jobs: working-directory: ${{ runner.temp }}/digests run: | jq -s 'add' ${{ runner.temp }}/digests/*.json > ${{ runner.temp }}/all.json + cat ${{ runner.temp }}/all.json JSON_FILE=${{ runner.temp }}/all.json for key in $(jq -r 'keys[]' "$JSON_FILE"); do image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") - done + echo "Creating manifest for image: $image_name" docker buildx imagetools create \ $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json) \ $(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) From 2c6eef7645541c7d2faa16892358fd3f1c02dd1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 04:49:29 -0600 Subject: [PATCH 042/125] wip --- .github/workflows/pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 96717be..db8c140 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -155,6 +155,7 @@ jobs: for key in $(jq -r 'keys[]' "$JSON_FILE"); do image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") echo "Creating manifest for image: $image_name" + echo "Tags: $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json)" docker buildx imagetools create \ $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json) \ $(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) From 147b27d0f34de5534f9455386922c2a6a8572b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 04:51:35 -0600 Subject: [PATCH 043/125] wip --- .github/workflows/pull-request.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index db8c140..72c58d9 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -149,13 +149,15 @@ jobs: - name: Create manifest list and push working-directory: ${{ runner.temp }}/digests run: | - jq -s 'add' ${{ runner.temp }}/digests/*.json > ${{ runner.temp }}/all.json - cat ${{ runner.temp }}/all.json - JSON_FILE=${{ runner.temp }}/all.json + ls -al ${{ runner.temp }}/digests + cat ${{ runner.temp }}/digests/* + jq -s 'add' ${{ runner.temp }}/digests/*.json > ${{ runner.temp }}/digests/all.json + cat ${{ runner.temp }}/digests/all.json + JSON_FILE=${{ runner.temp }}/digests/.json for key in $(jq -r 'keys[]' "$JSON_FILE"); do image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") echo "Creating manifest for image: $image_name" - echo "Tags: $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json)" + echo "Tags: $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json)g" docker buildx imagetools create \ $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json) \ $(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) From ecd1eea3f6c1d8c9179d38065a83cb384c00e309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 04:55:08 -0600 Subject: [PATCH 044/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 72c58d9..39dbeeb 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -153,7 +153,7 @@ jobs: cat ${{ runner.temp }}/digests/* jq -s 'add' ${{ runner.temp }}/digests/*.json > ${{ runner.temp }}/digests/all.json cat ${{ runner.temp }}/digests/all.json - JSON_FILE=${{ runner.temp }}/digests/.json + JSON_FILE=${{ runner.temp }}/digests/all.json for key in $(jq -r 'keys[]' "$JSON_FILE"); do image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") echo "Creating manifest for image: $image_name" From ede8f013243b47f8284b5c19d3b70b6db6316967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 05:09:13 -0600 Subject: [PATCH 045/125] wip --- .github/workflows/pull-request.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 39dbeeb..1e22b1f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -151,7 +151,15 @@ jobs: run: | ls -al ${{ runner.temp }}/digests cat ${{ runner.temp }}/digests/* - jq -s 'add' ${{ runner.temp }}/digests/*.json > ${{ runner.temp }}/digests/all.json + jq -s ' + reduce .[] as $doc ({}; + reduce ($doc|to_entries[]) as $kv ( + .; + .[$kv.key].name = $kv.value.name + | .[$kv.key].digests = ((.[$kv.key].digests // []) + $kv.value.digests) + ) + ) + ' ${{ runner.temp }}/digests/*.json > ${{ runner.temp }}/digests/all.json cat ${{ runner.temp }}/digests/all.json JSON_FILE=${{ runner.temp }}/digests/all.json for key in $(jq -r 'keys[]' "$JSON_FILE"); do From be63935e1c6369c0d2a91a5a2a2888dbfc9e554f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 05:12:19 -0600 Subject: [PATCH 046/125] wip --- .github/workflows/pull-request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1e22b1f..0ac2b7d 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -161,11 +161,12 @@ jobs: ) ' ${{ runner.temp }}/digests/*.json > ${{ runner.temp }}/digests/all.json cat ${{ runner.temp }}/digests/all.json + cat ${{ runner.temp }}/bake-meta.json JSON_FILE=${{ runner.temp }}/digests/all.json for key in $(jq -r 'keys[]' "$JSON_FILE"); do image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") echo "Creating manifest for image: $image_name" - echo "Tags: $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json)g" + echo "Tags: $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json)" docker buildx imagetools create \ $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json) \ $(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) From 6d94865c557d5cc25e425fa12d470c233f802586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 05:27:49 -0600 Subject: [PATCH 047/125] wip --- .github/workflows/pull-request.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0ac2b7d..8e88044 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -165,11 +165,13 @@ jobs: JSON_FILE=${{ runner.temp }}/digests/all.json for key in $(jq -r 'keys[]' "$JSON_FILE"); do image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") + image_digests=$(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) + image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t " + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) echo "Creating manifest for image: $image_name" echo "Tags: $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json)" docker buildx imagetools create \ - $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json) \ - $(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) + ${image_tags} \ + ${image_digests} done - name: Inspect image From d1f007a16aa851fd9ea99f272139fdbc7481c053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 05:34:08 -0600 Subject: [PATCH 048/125] wip --- .github/workflows/pull-request.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8e88044..6b541cb 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -166,7 +166,7 @@ jobs: for key in $(jq -r 'keys[]' "$JSON_FILE"); do image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") image_digests=$(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) - image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t " + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) + image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t " + sub(".*:"; "${image_name}:")) | join(" ")' ${{ runner.temp }}/bake-meta.json) echo "Creating manifest for image: $image_name" echo "Tags: $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json)" docker buildx imagetools create \ @@ -175,5 +175,10 @@ jobs: done - name: Inspect image + working-directory: ${{ runner.temp }}/digests run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' ${{ runner.temp }}/bake-meta.json) + JSON_FILE=${{ runner.temp }}/digests/all.json + for key in $(jq -r 'keys[]' "$JSON_FILE"); do + image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") + docker buildx imagetools inspect ${image_name}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' ${{ runner.temp }}/bake-meta.json) + done From 1d7601add12052409a99324c3e51fa8ea9406b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 05:37:02 -0600 Subject: [PATCH 049/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6b541cb..03620c2 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -166,7 +166,7 @@ jobs: for key in $(jq -r 'keys[]' "$JSON_FILE"); do image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") image_digests=$(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) - image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t " + sub(".*:"; "${image_name}:")) | join(" ")' ${{ runner.temp }}/bake-meta.json) + image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t ${image_name}:" + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) echo "Creating manifest for image: $image_name" echo "Tags: $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json)" docker buildx imagetools create \ From 83043bdd14dfaa40b2498990e8e57e9e775d45e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 05:43:17 -0600 Subject: [PATCH 050/125] wip --- .github/workflows/pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 03620c2..21cc2de 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -166,9 +166,9 @@ jobs: for key in $(jq -r 'keys[]' "$JSON_FILE"); do image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") image_digests=$(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) - image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t ${image_name}:" + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) + image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t '${image_name}':" + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) echo "Creating manifest for image: $image_name" - echo "Tags: $(jq -cr '.target."docker-metadata-action".tags | map(select(startswith("${image_name}")) | "-t " + .) | join(" ")' ${{ runner.temp }}/bake-meta.json)" + echo "Tags: ${image_tags}" docker buildx imagetools create \ ${image_tags} \ ${image_digests} From 779de40345171da7180a8045b4f4aed4c2c0576a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 11:42:29 -0600 Subject: [PATCH 051/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 21cc2de..96c39de 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -108,7 +108,7 @@ jobs: - name: Export container digests run: | mkdir -p ${{ runner.temp }}/digests - echo '${{ steps.bake.outputs.metadata }}' | jq 'with_entries(select(.key | startswith("build-"))) | map_values({name: ."image.name", digests: [."containerimage.digest"]})' > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json + echo '${{ steps.bake.outputs.metadata }}' | jq 'with_entries(select(.value["containerimage.digest"]?) | .value |= {name: .["image.name"], digests:[.["containerimage.digest"]]})' > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json - name: Upload digest uses: actions/upload-artifact@v4 From 6f368da24014109aea26654c782da644ea736944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 13:37:43 -0600 Subject: [PATCH 052/125] wip --- .github/workflows/pull-request-callable.yml | 202 ++++++++++++++++++++ .github/workflows/pull-request.yml | 168 +--------------- 2 files changed, 210 insertions(+), 160 deletions(-) create mode 100644 .github/workflows/pull-request-callable.yml diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml new file mode 100644 index 0000000..a9e946e --- /dev/null +++ b/.github/workflows/pull-request-callable.yml @@ -0,0 +1,202 @@ +name: Pull Request Build + +on: + workflow_call: + secrets: + registry-password: + description: 'Password or token for registry login' + required: true + inputs: + registry-image: + description: 'Container registry + image prefix (e.g. ghcr.io/org/repo)' + required: true + type: string + bake-target: + description: 'Target name for `docker buildx bake`' + required: false + type: string + default: 'build' + dockerhub-username: + description: 'Username for registry login' + required: true + type: string + runner-arm64: + description: 'Runner label for ARM64 jobs' + required: false + type: string + default: 'ubuntu-22.04-arm' + runner-default: + description: 'Runner label for non‑ARM jobs' + required: false + type: string + default: 'ubuntu-22.04' + registry: + description: 'Docker registry domain' + required: false + type: string + default: 'ghcr.io' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + packages: write + +jobs: + prepare: + runs-on: ${{ inputs.runner-default }} + outputs: + matrix: ${{ steps.platforms.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create matrix + id: platforms + run: | + echo "matrix=$(docker buildx bake ${{ inputs.bake-target }} \ + --print | jq -cr '.target | to_entries | map(.value.platforms[]) | unique')" \ + >> $GITHUB_OUTPUT + + - name: Show matrix + run: echo ${{ steps.platforms.outputs.matrix }} + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ inputs.registry-image }} + + - name: Rename meta file + run: mv "${{ steps.meta.outputs.bake-file }}" "${{ runner.temp }}/bake-meta.json" + + - name: Upload meta bake file + uses: actions/upload-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }}/bake-meta.json + if-no-files-found: error + retention-days: 1 + + build: + needs: prepare + runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-arm64 || inputs.runner-default }} + strategy: + fail-fast: false + matrix: + platform: ${{ fromJson(needs.prepare.outputs.matrix) }} + steps: + - name: Prepare env + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + + - name: Download meta bake file + uses: actions/download-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }} + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ inputs.registry }} + username: ${{ inputs.dockerhub-username }} + password: ${{ secrets.registry-password }} + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build & push images + id: bake + uses: docker/bake-action@v6 + env: + NO_TAG: true + with: + files: | + ./docker-bake.hcl + cwd://${{ runner.temp }}/bake-meta.json + targets: ${{ inputs.bake-target }} + set: | + ${{ inputs.registry-image != '' && format('*.tags={0}', inputs.registry-image) || '' }} + *.platform=${{ matrix.platform }} + *.output=type=image,push-by-digest=true,name-canonical=true,push=true + + - name: Export container digests + run: | + mkdir -p ${{ runner.temp }}/digests + echo "${{ steps.bake.outputs.metadata }}" | \ + jq 'with_entries(select(.value["containerimage.digest"]?) | + .value |= {name: .["image.name"], digests:[.["containerimage.digest"]]})' \ + > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-${{ env.PLATFORM_PAIR }} + path: ${{ runner.temp }}/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + needs: build + runs-on: ${{ inputs.runner-default }} + steps: + - name: Download meta bake file + uses: actions/download-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }} + + - name: Download all digests + uses: actions/download-artifact@v4 + with: + path: ${{ runner.temp }}/digests + pattern: digests-* + merge-multiple: true + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ inputs.registry }} + username: ${{ inputs.dockerhub-username }} + password: ${{ secrets.registry-password }} + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Create manifest lists & push + working-directory: ${{ runner.temp }}/digests + run: | + jq -s ' + reduce .[] as $doc ({}; reduce ($doc|to_entries[]) as $kv ( + .; + .[$kv.key].name = $kv.value.name + | .[$kv.key].digests = ((.[$kv.key].digests // []) + $kv.value.digests) + )) + ' *.json > all.json + + for key in $(jq -r 'keys[]' all.json); do + image=$(jq -r ".\"$key\".name" all.json) + digests=$(jq -r ".\"$key\".digests[]" all.json | \ + xargs -I{} echo "${image}@{}") + tags=$(jq -cr '(.target."docker-metadata-action".tags // []) | + map("-t '${image}':" + sub(".*:"; "")) | join(" ")' \ + ../bake-meta.json) + docker buildx imagetools create $tags $digests + done + + - name: Inspect published images + working-directory: ${{ runner.temp }}/digests + run: | + version=$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' \ + ../bake-meta.json) + for key in $(jq -r 'keys[]' all.json); do + image=$(jq -r ".\"$key\".name" all.json) + docker buildx imagetools inspect "${image}:${version}" + done diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 96c39de..c61149e 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -22,163 +22,11 @@ env: REGISTRY: ghcr.io jobs: - prepare: - runs-on: ubuntu-22.04 - outputs: - matrix: ${{ steps.platforms.outputs.matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Create matrix - id: platforms - run: | - echo "matrix=$(docker buildx bake ${{ env.BAKE_TARGET }} --print | jq -cr '.target | to_entries | map(.value.platforms[]) | unique')" >>${GITHUB_OUTPUT} - - - name: Show matrix - run: | - echo ${{ steps.platforms.outputs.matrix }} - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY_IMAGE }} - - - name: Rename meta bake definition file - run: | - mv "${{ steps.meta.outputs.bake-file }}" "${{ runner.temp }}/bake-meta.json" - - - name: Upload meta bake definition - uses: actions/upload-artifact@v4 - with: - name: bake-meta - path: ${{ runner.temp }}/bake-meta.json - if-no-files-found: error - retention-days: 1 - - build: - runs-on: ${{ matrix.platform == 'linux/arm64' && 'ubuntu-22.04-arm' || 'ubuntu-22.04' }} - needs: - - prepare - strategy: - fail-fast: false - matrix: - platform: ${{ fromJson(needs.prepare.outputs.matrix) }} - steps: - - name: Prepare - run: | - platform=${{ matrix.platform }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - - - name: Download meta bake definition - uses: actions/download-artifact@v4 - with: - name: bake-meta - path: ${{ runner.temp }} - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ env.DOCKERHUB_USERNAME }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build - id: bake - uses: docker/bake-action@v6 - env: - NO_TAG: true - with: - files: | - ./docker-bake.hcl - cwd://${{ runner.temp }}/bake-meta.json - targets: ${{ env.BAKE_TARGET }} - set: | - ${{ env.REGISTRY_IMAGE != '' && format('*.tags={0}', env.REGISTRY_IMAGE) || '' }} - *.platform=${{ matrix.platform }} - *.output=type=image,push-by-digest=true,name-canonical=true,push=true - - - name: Export container digests - run: | - mkdir -p ${{ runner.temp }}/digests - echo '${{ steps.bake.outputs.metadata }}' | jq 'with_entries(select(.value["containerimage.digest"]?) | .value |= {name: .["image.name"], digests:[.["containerimage.digest"]]})' > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json - - - name: Upload digest - uses: actions/upload-artifact@v4 - with: - name: digests-${{ env.PLATFORM_PAIR }} - path: ${{ runner.temp }}/digests/* - if-no-files-found: error - retention-days: 1 - - merge: - runs-on: ubuntu-22.04 - needs: - - build - steps: - - name: Download meta bake definition - uses: actions/download-artifact@v4 - with: - name: bake-meta - path: ${{ runner.temp }} - - - name: Download digests - uses: actions/download-artifact@v4 - with: - path: ${{ runner.temp }}/digests - pattern: digests-* - merge-multiple: true - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ env.DOCKERHUB_USERNAME }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Create manifest list and push - working-directory: ${{ runner.temp }}/digests - run: | - ls -al ${{ runner.temp }}/digests - cat ${{ runner.temp }}/digests/* - jq -s ' - reduce .[] as $doc ({}; - reduce ($doc|to_entries[]) as $kv ( - .; - .[$kv.key].name = $kv.value.name - | .[$kv.key].digests = ((.[$kv.key].digests // []) + $kv.value.digests) - ) - ) - ' ${{ runner.temp }}/digests/*.json > ${{ runner.temp }}/digests/all.json - cat ${{ runner.temp }}/digests/all.json - cat ${{ runner.temp }}/bake-meta.json - JSON_FILE=${{ runner.temp }}/digests/all.json - for key in $(jq -r 'keys[]' "$JSON_FILE"); do - image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") - image_digests=$(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) - image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t '${image_name}':" + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) - echo "Creating manifest for image: $image_name" - echo "Tags: ${image_tags}" - docker buildx imagetools create \ - ${image_tags} \ - ${image_digests} - done - - - name: Inspect image - working-directory: ${{ runner.temp }}/digests - run: | - JSON_FILE=${{ runner.temp }}/digests/all.json - for key in $(jq -r 'keys[]' "$JSON_FILE"); do - image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") - docker buildx imagetools inspect ${image_name}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' ${{ runner.temp }}/bake-meta.json) - done + pr-build: + uses: ./.github/workflows/pull-request-callable.yml + with: + registry-image: '' + bake-target: build + dockerhub-username: ${{ github.actor }} + secrets: + registry-password: ${{ secrets.GITHUB_TOKEN }} From 557b0a629fe15b94685ca516e6570e7ef19af223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 13:41:25 -0600 Subject: [PATCH 053/125] wip --- .github/workflows/pull-request-callable.yml | 8 ++++---- .github/workflows/pull-request.yml | 11 +---------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index a9e946e..8bf15bd 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -9,14 +9,14 @@ on: inputs: registry-image: description: 'Container registry + image prefix (e.g. ghcr.io/org/repo)' - required: true + required: false type: string bake-target: description: 'Target name for `docker buildx bake`' required: false type: string default: 'build' - dockerhub-username: + registry-username: description: 'Username for registry login' required: true type: string @@ -103,7 +103,7 @@ jobs: uses: docker/login-action@v3 with: registry: ${{ inputs.registry }} - username: ${{ inputs.dockerhub-username }} + username: ${{ inputs.registry-username }} password: ${{ secrets.registry-password }} - name: Setup QEMU @@ -164,7 +164,7 @@ jobs: uses: docker/login-action@v3 with: registry: ${{ inputs.registry }} - username: ${{ inputs.dockerhub-username }} + username: ${{ inputs.registry-username }} password: ${{ secrets.registry-password }} - name: Setup Docker Buildx diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index c61149e..ed363e8 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -5,22 +5,13 @@ on: types: [opened, synchronize, reopened] concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }} cancel-in-progress: true permissions: contents: read packages: write -env: - # REGISTRY_IMAGE: ghcr.io/${{ github.repository }} - REGISTRY_IMAGE: '' - BAKE_TARGET: build - DOCKERHUB_USERNAME: ${{ github.actor }} - RUNNER_ARM64: ubuntu-22.04-arm - RUNNER_DEFAULT: ubuntu-22.04 - REGISTRY: ghcr.io - jobs: pr-build: uses: ./.github/workflows/pull-request-callable.yml From 3d7d4dd8fab702fb2e327a1c8306993611b3cb81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 13:42:17 -0600 Subject: [PATCH 054/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index ed363e8..1306acc 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -18,6 +18,6 @@ jobs: with: registry-image: '' bake-target: build - dockerhub-username: ${{ github.actor }} + registry-username: ${{ github.actor }} secrets: registry-password: ${{ secrets.GITHUB_TOKEN }} From 9c6beb588ea4d24742210c6f9d58c145d4d4e988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 13:50:09 -0600 Subject: [PATCH 055/125] wip --- .github/workflows/pull-request-callable.yml | 45 ++++++++++----------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 8bf15bd..98c1c5c 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -130,10 +130,7 @@ jobs: - name: Export container digests run: | mkdir -p ${{ runner.temp }}/digests - echo "${{ steps.bake.outputs.metadata }}" | \ - jq 'with_entries(select(.value["containerimage.digest"]?) | - .value |= {name: .["image.name"], digests:[.["containerimage.digest"]]})' \ - > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json + echo '${{ steps.bake.outputs.metadata }}' | jq 'with_entries(select(.value["containerimage.digest"]?) | .value |= {name: .["image.name"], digests:[.["containerimage.digest"]]})' > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json - name: Upload digest uses: actions/upload-artifact@v4 @@ -173,30 +170,30 @@ jobs: - name: Create manifest lists & push working-directory: ${{ runner.temp }}/digests run: | + JSON_FILE=${{ runner.temp }}/digests/all.json jq -s ' - reduce .[] as $doc ({}; reduce ($doc|to_entries[]) as $kv ( - .; - .[$kv.key].name = $kv.value.name - | .[$kv.key].digests = ((.[$kv.key].digests // []) + $kv.value.digests) - )) - ' *.json > all.json - - for key in $(jq -r 'keys[]' all.json); do - image=$(jq -r ".\"$key\".name" all.json) - digests=$(jq -r ".\"$key\".digests[]" all.json | \ - xargs -I{} echo "${image}@{}") - tags=$(jq -cr '(.target."docker-metadata-action".tags // []) | - map("-t '${image}':" + sub(".*:"; "")) | join(" ")' \ - ../bake-meta.json) - docker buildx imagetools create $tags $digests + reduce .[] as $doc ({}; + reduce ($doc|to_entries[]) as $kv ( + .; + .[$kv.key].name = $kv.value.name + | .[$kv.key].digests = ((.[$kv.key].digests // []) + $kv.value.digests) + ) + ) + ' ${{ runner.temp }}/digests/*.json > ${JSON_FILE} + for key in $(jq -r 'keys[]' "$JSON_FILE"); do + image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") + image_digests=$(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) + image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t '${image_name}':" + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) + docker buildx imagetools create \ + ${image_tags} \ + ${image_digests} done - name: Inspect published images working-directory: ${{ runner.temp }}/digests run: | - version=$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' \ - ../bake-meta.json) - for key in $(jq -r 'keys[]' all.json); do - image=$(jq -r ".\"$key\".name" all.json) - docker buildx imagetools inspect "${image}:${version}" + JSON_FILE=${{ runner.temp }}/digests/all.json + for key in $(jq -r 'keys[]' "$JSON_FILE"); do + image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") + docker buildx imagetools inspect ${image_name}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' ${{ runner.temp }}/bake-meta.json) done From 5abdb1d3051c552c407c7080e4ff2d4fd115122f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 14:57:05 -0600 Subject: [PATCH 056/125] wip --- .github/actions/bake-prepare.yml | 199 ++++++++++++++++++ .../actions/buildx-bake/prepare/action.yml | 50 +++++ .github/workflows/pull-request-callable.yml | 2 + 3 files changed, 251 insertions(+) create mode 100644 .github/actions/bake-prepare.yml create mode 100644 .github/actions/buildx-bake/prepare/action.yml diff --git a/.github/actions/bake-prepare.yml b/.github/actions/bake-prepare.yml new file mode 100644 index 0000000..98c1c5c --- /dev/null +++ b/.github/actions/bake-prepare.yml @@ -0,0 +1,199 @@ +name: Pull Request Build + +on: + workflow_call: + secrets: + registry-password: + description: 'Password or token for registry login' + required: true + inputs: + registry-image: + description: 'Container registry + image prefix (e.g. ghcr.io/org/repo)' + required: false + type: string + bake-target: + description: 'Target name for `docker buildx bake`' + required: false + type: string + default: 'build' + registry-username: + description: 'Username for registry login' + required: true + type: string + runner-arm64: + description: 'Runner label for ARM64 jobs' + required: false + type: string + default: 'ubuntu-22.04-arm' + runner-default: + description: 'Runner label for non‑ARM jobs' + required: false + type: string + default: 'ubuntu-22.04' + registry: + description: 'Docker registry domain' + required: false + type: string + default: 'ghcr.io' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + packages: write + +jobs: + prepare: + runs-on: ${{ inputs.runner-default }} + outputs: + matrix: ${{ steps.platforms.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create matrix + id: platforms + run: | + echo "matrix=$(docker buildx bake ${{ inputs.bake-target }} \ + --print | jq -cr '.target | to_entries | map(.value.platforms[]) | unique')" \ + >> $GITHUB_OUTPUT + + - name: Show matrix + run: echo ${{ steps.platforms.outputs.matrix }} + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ inputs.registry-image }} + + - name: Rename meta file + run: mv "${{ steps.meta.outputs.bake-file }}" "${{ runner.temp }}/bake-meta.json" + + - name: Upload meta bake file + uses: actions/upload-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }}/bake-meta.json + if-no-files-found: error + retention-days: 1 + + build: + needs: prepare + runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-arm64 || inputs.runner-default }} + strategy: + fail-fast: false + matrix: + platform: ${{ fromJson(needs.prepare.outputs.matrix) }} + steps: + - name: Prepare env + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + + - name: Download meta bake file + uses: actions/download-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }} + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ inputs.registry }} + username: ${{ inputs.registry-username }} + password: ${{ secrets.registry-password }} + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build & push images + id: bake + uses: docker/bake-action@v6 + env: + NO_TAG: true + with: + files: | + ./docker-bake.hcl + cwd://${{ runner.temp }}/bake-meta.json + targets: ${{ inputs.bake-target }} + set: | + ${{ inputs.registry-image != '' && format('*.tags={0}', inputs.registry-image) || '' }} + *.platform=${{ matrix.platform }} + *.output=type=image,push-by-digest=true,name-canonical=true,push=true + + - name: Export container digests + run: | + mkdir -p ${{ runner.temp }}/digests + echo '${{ steps.bake.outputs.metadata }}' | jq 'with_entries(select(.value["containerimage.digest"]?) | .value |= {name: .["image.name"], digests:[.["containerimage.digest"]]})' > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-${{ env.PLATFORM_PAIR }} + path: ${{ runner.temp }}/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + needs: build + runs-on: ${{ inputs.runner-default }} + steps: + - name: Download meta bake file + uses: actions/download-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }} + + - name: Download all digests + uses: actions/download-artifact@v4 + with: + path: ${{ runner.temp }}/digests + pattern: digests-* + merge-multiple: true + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ inputs.registry }} + username: ${{ inputs.registry-username }} + password: ${{ secrets.registry-password }} + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Create manifest lists & push + working-directory: ${{ runner.temp }}/digests + run: | + JSON_FILE=${{ runner.temp }}/digests/all.json + jq -s ' + reduce .[] as $doc ({}; + reduce ($doc|to_entries[]) as $kv ( + .; + .[$kv.key].name = $kv.value.name + | .[$kv.key].digests = ((.[$kv.key].digests // []) + $kv.value.digests) + ) + ) + ' ${{ runner.temp }}/digests/*.json > ${JSON_FILE} + for key in $(jq -r 'keys[]' "$JSON_FILE"); do + image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") + image_digests=$(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) + image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t '${image_name}':" + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) + docker buildx imagetools create \ + ${image_tags} \ + ${image_digests} + done + + - name: Inspect published images + working-directory: ${{ runner.temp }}/digests + run: | + JSON_FILE=${{ runner.temp }}/digests/all.json + for key in $(jq -r 'keys[]' "$JSON_FILE"); do + image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") + docker buildx imagetools inspect ${image_name}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' ${{ runner.temp }}/bake-meta.json) + done diff --git a/.github/actions/buildx-bake/prepare/action.yml b/.github/actions/buildx-bake/prepare/action.yml new file mode 100644 index 0000000..a69db84 --- /dev/null +++ b/.github/actions/buildx-bake/prepare/action.yml @@ -0,0 +1,50 @@ +name: "Prepare Build Matrix & Metadata" +description: "Generate platform matrix and bake metadata file for later steps." +inputs: + bake-target: + description: 'Target name for `docker buildx bake`' + required: false + type: string + default: 'build' + registry-image: + description: 'Container registry + image prefix (e.g. ghcr.io/org/repo)' + required: false + type: string +outputs: + matrix: + description: 'JSON array of platforms' + value: ${{ steps.platforms.outputs.matrix }} +runs: + using: "composite" + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create matrix + id: platforms + shell: bash + run: | + echo "matrix=$(docker buildx bake ${{ inputs.bake-target }} \ + --print | jq -cr '.target | to_entries | map(.value.platforms[]) | unique')" \ + >> $GITHUB_OUTPUT + + - name: Show matrix + run: echo ${{ steps.platforms.outputs.matrix }} + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ inputs.registry-image }} + + - name: Rename meta file + run: | + mv "${{ steps.meta.outputs.bake-file }}" "${{ runner.temp }}/bake-meta.json" + + - name: Upload meta bake file + uses: actions/upload-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }}/bake-meta.json + if-no-files-found: error + retention-days: 1 diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 98c1c5c..cdfaed1 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -90,6 +90,7 @@ jobs: steps: - name: Prepare env run: | + ls -al platform=${{ matrix.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV @@ -129,6 +130,7 @@ jobs: - name: Export container digests run: | + ls -al mkdir -p ${{ runner.temp }}/digests echo '${{ steps.bake.outputs.metadata }}' | jq 'with_entries(select(.value["containerimage.digest"]?) | .value |= {name: .["image.name"], digests:[.["containerimage.digest"]]})' > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json From 34d99b46e84c3ac7be137f555ff7f058d8631763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 15:01:05 -0600 Subject: [PATCH 057/125] wip --- .github/actions/buildx-bake/build/action.yml | 81 ++++++++++++++++++++ .github/actions/buildx-bake/merge/action.yml | 69 +++++++++++++++++ .github/workflows/pull-request-callable.yml | 2 - 3 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 .github/actions/buildx-bake/build/action.yml create mode 100644 .github/actions/buildx-bake/merge/action.yml diff --git a/.github/actions/buildx-bake/build/action.yml b/.github/actions/buildx-bake/build/action.yml new file mode 100644 index 0000000..393fbfa --- /dev/null +++ b/.github/actions/buildx-bake/build/action.yml @@ -0,0 +1,81 @@ +name: "Build & Push Images" +description: "Download metadata, build multi‑arch images, push by digest, and upload per‑platform digests." +inputs: + bake-target: + description: 'Target name for `docker buildx bake`' + required: false + type: string + default: 'build' + registry-image: + description: 'Container registry + image prefix' + required: false + type: string + registry-username: + description: 'Username for registry login' + required: true + type: string + registry-password: + description: 'Password or token for registry login' + required: true + type: string + registry: + description: 'Docker registry domain' + required: false + type: string + default: 'ghcr.io' +runs: + using: "composite" + steps: + - name: Prepare env + shell: bash + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + + - name: Download meta bake file + uses: actions/download-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }} + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ inputs.registry }} + username: ${{ inputs.registry-username }} + password: ${{ inputs.registry-password }} + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build & push images + id: bake + uses: docker/bake-action@v6 + env: + NO_TAG: true + with: + files: | + ./docker-bake.hcl + cwd://${{ runner.temp }}/bake-meta.json + targets: ${{ inputs.bake-target }} + set: | + ${{ inputs.registry-image != '' && format('*.tags={0}', inputs.registry-image) || '' }} + *.platform=${{ matrix.platform }} + *.output=type=image,push-by-digest=true,name-canonical=true,push=true + + - name: Export container digests + shell: bash + run: | + mkdir -p ${{ runner.temp }}/digests + echo '${{ steps.bake.outputs.metadata }}' | jq 'with_entries(select(.value["containerimage.digest"]?) | .value |= {name: .["image.name"], digests:[.["containerimage.digest"]]})' > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-${{ env.PLATFORM_PAIR }} + path: ${{ runner.temp }}/digests/* + if-no-files-found: error + retention-days: 1 diff --git a/.github/actions/buildx-bake/merge/action.yml b/.github/actions/buildx-bake/merge/action.yml new file mode 100644 index 0000000..2e47c09 --- /dev/null +++ b/.github/actions/buildx-bake/merge/action.yml @@ -0,0 +1,69 @@ +name: "Merge & Publish Manifests" +description: "Download digests, create manifest lists, push them, and inspect the published images." +inputs: + registry-username: + description: 'Username for registry login' + required: true + type: string + registry: + description: 'Docker registry domain' + required: false + type: string + default: 'ghcr.io' +runs: + using: "composite" + steps: + - name: Download meta bake file + uses: actions/download-artifact@v4 + with: + name: bake-meta + path: ${{ runner.temp }} + + - name: Download all digests + uses: actions/download-artifact@v4 + with: + path: ${{ runner.temp }}/digests + pattern: digests-* + merge-multiple: true + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ inputs.registry }} + username: ${{ inputs.registry-username }} + password: ${{ secrets.registry-password }} + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Create manifest lists & push + shell: bash + run: | + JSON_FILE=${{ runner.temp }}/digests/all.json + jq -s ' + reduce .[] as $doc ({}; reduce ($doc|to_entries[]) as $kv ( + .; + .[$kv.key].name = $kv.value.name + | .[$kv.key].digests = ((.[$kv.key].digests // []) + $kv.value.digests) + )) + ' ${{ runner.temp }}/digests/*.json > ${JSON_FILE} + + for key in $(jq -r 'keys[]' "$JSON_FILE"); do + image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") + image_digests=$(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) + image_tags=$(jq -cr '(.target."docker-metadata-action".tags // []) | + map("-t ${image_name}:" + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) + docker buildx imagetools create \ + ${image_tags} \ + ${image_digests} + done + + - name: Inspect published images + shell: bash + run: | + JSON_FILE=${{ runner.temp }}/digests/all.json + version=$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' ${{ runner.temp }}/bake-meta.json) + for key in $(jq -r 'keys[]' "$JSON_FILE"); do + image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") + docker buildx imagetools inspect ${image_name}:${version} + done diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index cdfaed1..98c1c5c 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -90,7 +90,6 @@ jobs: steps: - name: Prepare env run: | - ls -al platform=${{ matrix.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV @@ -130,7 +129,6 @@ jobs: - name: Export container digests run: | - ls -al mkdir -p ${{ runner.temp }}/digests echo '${{ steps.bake.outputs.metadata }}' | jq 'with_entries(select(.value["containerimage.digest"]?) | .value |= {name: .["image.name"], digests:[.["containerimage.digest"]]})' > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json From 671da32871e6db0502f9d194732159ecd17cf979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 15:08:53 -0600 Subject: [PATCH 058/125] wip --- .github/actions/bake-prepare.yml | 199 -------------------- .github/workflows/pull-request-callable.yml | 33 +--- 2 files changed, 5 insertions(+), 227 deletions(-) delete mode 100644 .github/actions/bake-prepare.yml diff --git a/.github/actions/bake-prepare.yml b/.github/actions/bake-prepare.yml deleted file mode 100644 index 98c1c5c..0000000 --- a/.github/actions/bake-prepare.yml +++ /dev/null @@ -1,199 +0,0 @@ -name: Pull Request Build - -on: - workflow_call: - secrets: - registry-password: - description: 'Password or token for registry login' - required: true - inputs: - registry-image: - description: 'Container registry + image prefix (e.g. ghcr.io/org/repo)' - required: false - type: string - bake-target: - description: 'Target name for `docker buildx bake`' - required: false - type: string - default: 'build' - registry-username: - description: 'Username for registry login' - required: true - type: string - runner-arm64: - description: 'Runner label for ARM64 jobs' - required: false - type: string - default: 'ubuntu-22.04-arm' - runner-default: - description: 'Runner label for non‑ARM jobs' - required: false - type: string - default: 'ubuntu-22.04' - registry: - description: 'Docker registry domain' - required: false - type: string - default: 'ghcr.io' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: read - packages: write - -jobs: - prepare: - runs-on: ${{ inputs.runner-default }} - outputs: - matrix: ${{ steps.platforms.outputs.matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Create matrix - id: platforms - run: | - echo "matrix=$(docker buildx bake ${{ inputs.bake-target }} \ - --print | jq -cr '.target | to_entries | map(.value.platforms[]) | unique')" \ - >> $GITHUB_OUTPUT - - - name: Show matrix - run: echo ${{ steps.platforms.outputs.matrix }} - - - name: Docker metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ inputs.registry-image }} - - - name: Rename meta file - run: mv "${{ steps.meta.outputs.bake-file }}" "${{ runner.temp }}/bake-meta.json" - - - name: Upload meta bake file - uses: actions/upload-artifact@v4 - with: - name: bake-meta - path: ${{ runner.temp }}/bake-meta.json - if-no-files-found: error - retention-days: 1 - - build: - needs: prepare - runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-arm64 || inputs.runner-default }} - strategy: - fail-fast: false - matrix: - platform: ${{ fromJson(needs.prepare.outputs.matrix) }} - steps: - - name: Prepare env - run: | - platform=${{ matrix.platform }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - - - name: Download meta bake file - uses: actions/download-artifact@v4 - with: - name: bake-meta - path: ${{ runner.temp }} - - - name: Login to registry - uses: docker/login-action@v3 - with: - registry: ${{ inputs.registry }} - username: ${{ inputs.registry-username }} - password: ${{ secrets.registry-password }} - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build & push images - id: bake - uses: docker/bake-action@v6 - env: - NO_TAG: true - with: - files: | - ./docker-bake.hcl - cwd://${{ runner.temp }}/bake-meta.json - targets: ${{ inputs.bake-target }} - set: | - ${{ inputs.registry-image != '' && format('*.tags={0}', inputs.registry-image) || '' }} - *.platform=${{ matrix.platform }} - *.output=type=image,push-by-digest=true,name-canonical=true,push=true - - - name: Export container digests - run: | - mkdir -p ${{ runner.temp }}/digests - echo '${{ steps.bake.outputs.metadata }}' | jq 'with_entries(select(.value["containerimage.digest"]?) | .value |= {name: .["image.name"], digests:[.["containerimage.digest"]]})' > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json - - - name: Upload digest - uses: actions/upload-artifact@v4 - with: - name: digests-${{ env.PLATFORM_PAIR }} - path: ${{ runner.temp }}/digests/* - if-no-files-found: error - retention-days: 1 - - merge: - needs: build - runs-on: ${{ inputs.runner-default }} - steps: - - name: Download meta bake file - uses: actions/download-artifact@v4 - with: - name: bake-meta - path: ${{ runner.temp }} - - - name: Download all digests - uses: actions/download-artifact@v4 - with: - path: ${{ runner.temp }}/digests - pattern: digests-* - merge-multiple: true - - - name: Login to registry - uses: docker/login-action@v3 - with: - registry: ${{ inputs.registry }} - username: ${{ inputs.registry-username }} - password: ${{ secrets.registry-password }} - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Create manifest lists & push - working-directory: ${{ runner.temp }}/digests - run: | - JSON_FILE=${{ runner.temp }}/digests/all.json - jq -s ' - reduce .[] as $doc ({}; - reduce ($doc|to_entries[]) as $kv ( - .; - .[$kv.key].name = $kv.value.name - | .[$kv.key].digests = ((.[$kv.key].digests // []) + $kv.value.digests) - ) - ) - ' ${{ runner.temp }}/digests/*.json > ${JSON_FILE} - for key in $(jq -r 'keys[]' "$JSON_FILE"); do - image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") - image_digests=$(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) - image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t '${image_name}':" + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) - docker buildx imagetools create \ - ${image_tags} \ - ${image_digests} - done - - - name: Inspect published images - working-directory: ${{ runner.temp }}/digests - run: | - JSON_FILE=${{ runner.temp }}/digests/all.json - for key in $(jq -r 'keys[]' "$JSON_FILE"); do - image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") - docker buildx imagetools inspect ${image_name}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' ${{ runner.temp }}/bake-meta.json) - done diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 98c1c5c..8ba8d4b 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -50,35 +50,12 @@ jobs: outputs: matrix: ${{ steps.platforms.outputs.matrix }} steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Create matrix - id: platforms - run: | - echo "matrix=$(docker buildx bake ${{ inputs.bake-target }} \ - --print | jq -cr '.target | to_entries | map(.value.platforms[]) | unique')" \ - >> $GITHUB_OUTPUT - - - name: Show matrix - run: echo ${{ steps.platforms.outputs.matrix }} - - - name: Docker metadata - id: meta - uses: docker/metadata-action@v5 + - name: Prepare matrix & metadata + id: prepare + uses: ./.github/actions/buildx-bake/prepare with: - images: ${{ inputs.registry-image }} - - - name: Rename meta file - run: mv "${{ steps.meta.outputs.bake-file }}" "${{ runner.temp }}/bake-meta.json" - - - name: Upload meta bake file - uses: actions/upload-artifact@v4 - with: - name: bake-meta - path: ${{ runner.temp }}/bake-meta.json - if-no-files-found: error - retention-days: 1 + bake-target: ${{ inputs.bake-target }} + registry-image: ${{ inputs.registry-image }} build: needs: prepare From a27b3c197d4d65160de1ab420afa1422beaf80c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 15:32:40 -0600 Subject: [PATCH 059/125] wip --- .github/workflows/pull-request-callable.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 8ba8d4b..94e2b2f 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -50,6 +50,12 @@ jobs: outputs: matrix: ${{ steps.platforms.outputs.matrix }} steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + - name: Prepare matrix & metadata id: prepare uses: ./.github/actions/buildx-bake/prepare From 1b5cdf71a193b3956c2aed0e8ea4385c5f9ccb47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 15:36:03 -0600 Subject: [PATCH 060/125] wip --- .github/actions/buildx-bake/prepare/action.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/actions/buildx-bake/prepare/action.yml b/.github/actions/buildx-bake/prepare/action.yml index a69db84..9f5dfc1 100644 --- a/.github/actions/buildx-bake/prepare/action.yml +++ b/.github/actions/buildx-bake/prepare/action.yml @@ -17,9 +17,6 @@ outputs: runs: using: "composite" steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Create matrix id: platforms shell: bash @@ -38,6 +35,7 @@ runs: images: ${{ inputs.registry-image }} - name: Rename meta file + shell: bash run: | mv "${{ steps.meta.outputs.bake-file }}" "${{ runner.temp }}/bake-meta.json" From 692761c4aae603d7c9fdece4221aac944d0b133c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:06:00 -0600 Subject: [PATCH 061/125] wip --- .github/actions/buildx-bake/prepare/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/buildx-bake/prepare/action.yml b/.github/actions/buildx-bake/prepare/action.yml index 9f5dfc1..393ea07 100644 --- a/.github/actions/buildx-bake/prepare/action.yml +++ b/.github/actions/buildx-bake/prepare/action.yml @@ -26,6 +26,7 @@ runs: >> $GITHUB_OUTPUT - name: Show matrix + shell: bash run: echo ${{ steps.platforms.outputs.matrix }} - name: Docker metadata From 6084c7e703d8e6c4b76a33246247b720822e4928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:09:43 -0600 Subject: [PATCH 062/125] wip --- .github/workflows/pull-request-callable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 94e2b2f..c6f7441 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -48,7 +48,7 @@ jobs: prepare: runs-on: ${{ inputs.runner-default }} outputs: - matrix: ${{ steps.platforms.outputs.matrix }} + matrix: ${{ steps.prepare.outputs.matrix }} steps: - name: Checkout repository uses: actions/checkout@v4 From e81c0c9b3906bb9e0e9d3f049322434267ac01f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:12:11 -0600 Subject: [PATCH 063/125] wip --- .github/workflows/pull-request-callable.yml | 57 +++------------------ 1 file changed, 6 insertions(+), 51 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index c6f7441..9ac4056 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -67,61 +67,16 @@ jobs: needs: prepare runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-arm64 || inputs.runner-default }} strategy: - fail-fast: false matrix: platform: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - - name: Prepare env - run: | - platform=${{ matrix.platform }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - - - name: Download meta bake file - uses: actions/download-artifact@v4 - with: - name: bake-meta - path: ${{ runner.temp }} - - - name: Login to registry - uses: docker/login-action@v3 - with: - registry: ${{ inputs.registry }} - username: ${{ inputs.registry-username }} - password: ${{ secrets.registry-password }} - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build & push images - id: bake - uses: docker/bake-action@v6 - env: - NO_TAG: true - with: - files: | - ./docker-bake.hcl - cwd://${{ runner.temp }}/bake-meta.json - targets: ${{ inputs.bake-target }} - set: | - ${{ inputs.registry-image != '' && format('*.tags={0}', inputs.registry-image) || '' }} - *.platform=${{ matrix.platform }} - *.output=type=image,push-by-digest=true,name-canonical=true,push=true - - - name: Export container digests - run: | - mkdir -p ${{ runner.temp }}/digests - echo '${{ steps.bake.outputs.metadata }}' | jq 'with_entries(select(.value["containerimage.digest"]?) | .value |= {name: .["image.name"], digests:[.["containerimage.digest"]]})' > ${{ runner.temp }}/digests/${{ env.PLATFORM_PAIR }}.json - - - name: Upload digest - uses: actions/upload-artifact@v4 + - uses: ./.github/actions/build with: - name: digests-${{ env.PLATFORM_PAIR }} - path: ${{ runner.temp }}/digests/* - if-no-files-found: error - retention-days: 1 + bake-target: ${{ inputs.bake-target }} + registry-image: ${{ inputs.registry }} + registry-username: ${{ inputs.registry-username }} + secrets: + registry-password: ${{ secrets.registry-password }} merge: needs: build From 175947950005a8980c06c927716328ec92f38e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:13:09 -0600 Subject: [PATCH 064/125] wip --- .github/workflows/pull-request-callable.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 9ac4056..91699b5 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -75,7 +75,6 @@ jobs: bake-target: ${{ inputs.bake-target }} registry-image: ${{ inputs.registry }} registry-username: ${{ inputs.registry-username }} - secrets: registry-password: ${{ secrets.registry-password }} merge: From 5b50515dcd78682787b48fd7148134f043e20a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:15:16 -0600 Subject: [PATCH 065/125] wip --- .github/workflows/pull-request-callable.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 91699b5..97822d1 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -50,7 +50,7 @@ jobs: outputs: matrix: ${{ steps.prepare.outputs.matrix }} steps: - - name: Checkout repository + - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 @@ -70,10 +70,13 @@ jobs: matrix: platform: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: + - name: Checkout + uses: actions/checkout@v4 - uses: ./.github/actions/build with: bake-target: ${{ inputs.bake-target }} - registry-image: ${{ inputs.registry }} + registry: ${{ inputs.registry }} + registry-image: ${{ inputs.registry-image }} registry-username: ${{ inputs.registry-username }} registry-password: ${{ secrets.registry-password }} From d5876a42858adf55a789d3cc587d435f54f9c38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:19:15 -0600 Subject: [PATCH 066/125] wip --- .github/actions/buildx-bake/build/action.yml | 18 +++--- .github/actions/buildx-bake/merge/action.yml | 16 ++--- .github/workflows/pull-request-callable.yml | 63 ++++---------------- 3 files changed, 29 insertions(+), 68 deletions(-) diff --git a/.github/actions/buildx-bake/build/action.yml b/.github/actions/buildx-bake/build/action.yml index 393fbfa..a9fa7aa 100644 --- a/.github/actions/buildx-bake/build/action.yml +++ b/.github/actions/buildx-bake/build/action.yml @@ -6,23 +6,21 @@ inputs: required: false type: string default: 'build' - registry-image: - description: 'Container registry + image prefix' + registry: + description: 'The container registry' required: false - type: string + default: 'ghcr.io' registry-username: - description: 'Username for registry login' + description: 'The container registry username' required: true - type: string + default: ${{ github.actor }} registry-password: - description: 'Password or token for registry login' + description: 'The container registry password' required: true - type: string - registry: - description: 'Docker registry domain' + registry-image: + description: 'Container registry + image prefix' required: false type: string - default: 'ghcr.io' runs: using: "composite" steps: diff --git a/.github/actions/buildx-bake/merge/action.yml b/.github/actions/buildx-bake/merge/action.yml index 2e47c09..537c322 100644 --- a/.github/actions/buildx-bake/merge/action.yml +++ b/.github/actions/buildx-bake/merge/action.yml @@ -1,15 +1,17 @@ name: "Merge & Publish Manifests" description: "Download digests, create manifest lists, push them, and inspect the published images." inputs: - registry-username: - description: 'Username for registry login' - required: true - type: string registry: - description: 'Docker registry domain' + description: 'The container registry' required: false - type: string default: 'ghcr.io' + registry-username: + description: 'The container registry username' + required: true + default: ${{ github.actor }} + registry-password: + description: 'The container registry password' + required: true runs: using: "composite" steps: @@ -31,7 +33,7 @@ runs: with: registry: ${{ inputs.registry }} username: ${{ inputs.registry-username }} - password: ${{ secrets.registry-password }} + password: ${{ inputs.registry-password }} - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 97822d1..1cf2c17 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -72,7 +72,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - uses: ./.github/actions/build + with: + fetch-depth: 0 + fetch-tags: true + + - uses: ./.github/actions/buildx-bake/build with: bake-target: ${{ inputs.bake-target }} registry: ${{ inputs.registry }} @@ -84,56 +88,13 @@ jobs: needs: build runs-on: ${{ inputs.runner-default }} steps: - - name: Download meta bake file - uses: actions/download-artifact@v4 - with: - name: bake-meta - path: ${{ runner.temp }} - - - name: Download all digests - uses: actions/download-artifact@v4 + - name: Checkout + uses: actions/checkout@v4 with: - path: ${{ runner.temp }}/digests - pattern: digests-* - merge-multiple: true + fetch-depth: 0 + fetch-tags: true - - name: Login to registry - uses: docker/login-action@v3 + - uses: ./.github/actions/buildx-bake/merge with: - registry: ${{ inputs.registry }} - username: ${{ inputs.registry-username }} - password: ${{ secrets.registry-password }} - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Create manifest lists & push - working-directory: ${{ runner.temp }}/digests - run: | - JSON_FILE=${{ runner.temp }}/digests/all.json - jq -s ' - reduce .[] as $doc ({}; - reduce ($doc|to_entries[]) as $kv ( - .; - .[$kv.key].name = $kv.value.name - | .[$kv.key].digests = ((.[$kv.key].digests // []) + $kv.value.digests) - ) - ) - ' ${{ runner.temp }}/digests/*.json > ${JSON_FILE} - for key in $(jq -r 'keys[]' "$JSON_FILE"); do - image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") - image_digests=$(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) - image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t '${image_name}':" + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) - docker buildx imagetools create \ - ${image_tags} \ - ${image_digests} - done - - - name: Inspect published images - working-directory: ${{ runner.temp }}/digests - run: | - JSON_FILE=${{ runner.temp }}/digests/all.json - for key in $(jq -r 'keys[]' "$JSON_FILE"); do - image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") - docker buildx imagetools inspect ${image_name}:$(jq -r '.target."docker-metadata-action".args.DOCKER_META_VERSION' ${{ runner.temp }}/bake-meta.json) - done + registry-username: ${{ inputs.registry-username }} + registry-password: ${{ secrets.registry-password }} From 8658b3dca62078f003744da666822a2b2edab98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:25:30 -0600 Subject: [PATCH 067/125] wip --- .github/actions/buildx-bake/merge/action.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/actions/buildx-bake/merge/action.yml b/.github/actions/buildx-bake/merge/action.yml index 537c322..a503eec 100644 --- a/.github/actions/buildx-bake/merge/action.yml +++ b/.github/actions/buildx-bake/merge/action.yml @@ -43,18 +43,18 @@ runs: run: | JSON_FILE=${{ runner.temp }}/digests/all.json jq -s ' - reduce .[] as $doc ({}; reduce ($doc|to_entries[]) as $kv ( - .; - .[$kv.key].name = $kv.value.name - | .[$kv.key].digests = ((.[$kv.key].digests // []) + $kv.value.digests) - )) - ' ${{ runner.temp }}/digests/*.json > ${JSON_FILE} - + reduce .[] as $doc ({}; + reduce ($doc|to_entries[]) as $kv ( + .; + .[$kv.key].name = $kv.value.name + | .[$kv.key].digests = ((.[$kv.key].digests // []) + $kv.value.digests) + ) + ) + ' ${{ runner.temp }}/digests/*.json > $JSON_FILE for key in $(jq -r 'keys[]' "$JSON_FILE"); do image_name=$(jq -r ".\"$key\".name" "$JSON_FILE") image_digests=$(jq -r ".\"$key\".digests[]" "$JSON_FILE" | while read -r digest; do echo "${image_name}@${digest} "; done) - image_tags=$(jq -cr '(.target."docker-metadata-action".tags // []) | - map("-t ${image_name}:" + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) + image_tags=$(jq -cr '(.target."docker-metadata-action".tags // [] ) | map("-t '${image_name}':" + sub(".*:"; "")) | join(" ")' ${{ runner.temp }}/bake-meta.json) docker buildx imagetools create \ ${image_tags} \ ${image_digests} From 179f023a689c0067581beba9c9910f3e618563d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:29:25 -0600 Subject: [PATCH 068/125] wip --- .github/workflows/pull-request-callable.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 1cf2c17..8373216 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -37,7 +37,7 @@ on: default: 'ghcr.io' concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }} cancel-in-progress: true permissions: @@ -45,7 +45,8 @@ permissions: packages: write jobs: - prepare: + image-prepare: + name: Prepare Image Build runs-on: ${{ inputs.runner-default }} outputs: matrix: ${{ steps.prepare.outputs.matrix }} @@ -63,8 +64,9 @@ jobs: bake-target: ${{ inputs.bake-target }} registry-image: ${{ inputs.registry-image }} - build: - needs: prepare + image-build: + name: Build Image + needs: image-prepare runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-arm64 || inputs.runner-default }} strategy: matrix: @@ -84,7 +86,8 @@ jobs: registry-username: ${{ inputs.registry-username }} registry-password: ${{ secrets.registry-password }} - merge: + image-merge: + name: Merge Image Digests Into Manifest needs: build runs-on: ${{ inputs.runner-default }} steps: From e6cd4d203425c64d3082bad822e10699d8d6114b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:30:18 -0600 Subject: [PATCH 069/125] wip --- .github/workflows/pull-request-callable.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 8373216..c996c60 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -70,7 +70,7 @@ jobs: runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-arm64 || inputs.runner-default }} strategy: matrix: - platform: ${{ fromJson(needs.prepare.outputs.matrix) }} + platform: ${{ fromJson(needs.iamge-prepare.outputs.matrix) }} steps: - name: Checkout uses: actions/checkout@v4 @@ -88,7 +88,7 @@ jobs: image-merge: name: Merge Image Digests Into Manifest - needs: build + needs: image-build runs-on: ${{ inputs.runner-default }} steps: - name: Checkout From cd04439381e6a79a164dd5f5f8b6e98fbc675d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:32:24 -0600 Subject: [PATCH 070/125] wip --- .github/workflows/pull-request-callable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index c996c60..297440d 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -87,7 +87,7 @@ jobs: registry-password: ${{ secrets.registry-password }} image-merge: - name: Merge Image Digests Into Manifest + name: Merge Image Manifest needs: image-build runs-on: ${{ inputs.runner-default }} steps: From 957178223294c092b6b232bb7cfe11d5a4959a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:32:47 -0600 Subject: [PATCH 071/125] wip --- .github/workflows/pull-request-callable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 297440d..42e34b9 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -37,7 +37,7 @@ on: default: 'ghcr.io' concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: From 756eb04172a6fa1fb760f64780d43dce24efbcbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:35:34 -0600 Subject: [PATCH 072/125] wip --- .github/workflows/pull-request-callable.yml | 4 ---- .github/workflows/pull-request.yml | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 42e34b9..7e09339 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -36,10 +36,6 @@ on: type: string default: 'ghcr.io' -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - permissions: contents: read packages: write diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1306acc..a871b1f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -15,6 +15,7 @@ permissions: jobs: pr-build: uses: ./.github/workflows/pull-request-callable.yml + name: Build Image (Bake) with: registry-image: '' bake-target: build From 5de44b709f1e13d71cae0120c6b91126ab98b20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 20:36:01 -0600 Subject: [PATCH 073/125] wip --- .github/workflows/pull-request-callable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 7e09339..26bf7c8 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -66,7 +66,7 @@ jobs: runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-arm64 || inputs.runner-default }} strategy: matrix: - platform: ${{ fromJson(needs.iamge-prepare.outputs.matrix) }} + platform: ${{ fromJson(needs.image-prepare.outputs.matrix) }} steps: - name: Checkout uses: actions/checkout@v4 From 69f70efe384df152fa9830d83446fd3747daaefc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 21:04:30 -0600 Subject: [PATCH 074/125] wip --- .github/workflows/pull-request-callable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 26bf7c8..8c6c2fe 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -83,7 +83,7 @@ jobs: registry-password: ${{ secrets.registry-password }} image-merge: - name: Merge Image Manifest + name: Push Image needs: image-build runs-on: ${{ inputs.runner-default }} steps: From 2f46472d9dc12f22dddf4fae292692209b9c3a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Sun, 27 Jul 2025 21:15:02 -0600 Subject: [PATCH 075/125] wip --- .github/actions/buildx-bake/prepare/action.yml | 8 ++++++++ .github/workflows/pull-request-callable.yml | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/actions/buildx-bake/prepare/action.yml b/.github/actions/buildx-bake/prepare/action.yml index 393ea07..d9e8eb5 100644 --- a/.github/actions/buildx-bake/prepare/action.yml +++ b/.github/actions/buildx-bake/prepare/action.yml @@ -6,6 +6,12 @@ inputs: required: false type: string default: 'build' + meta-tags: + description: 'The tags to add to the image' + required: false + meta-labels: + description: 'The labels to add to the image' + required: false registry-image: description: 'Container registry + image prefix (e.g. ghcr.io/org/repo)' required: false @@ -34,6 +40,8 @@ runs: uses: docker/metadata-action@v5 with: images: ${{ inputs.registry-image }} + tags: ${{ inputs.meta-tags }} + labels: ${{ inputs.meta-labels }} - name: Rename meta file shell: bash diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 8c6c2fe..c0c7052 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -16,6 +16,14 @@ on: required: false type: string default: 'build' + meta-tags: + description: 'The tags to add to the image' + required: false + type: string + meta-labels: + description: 'The labels to add to the image' + required: false + type: string registry-username: description: 'Username for registry login' required: true @@ -59,6 +67,14 @@ jobs: with: bake-target: ${{ inputs.bake-target }} registry-image: ${{ inputs.registry-image }} + meta-labels: + ${{ inputs.meta-labels }} + meta-tags: | + type=edge,branch=$repo.default_branch,event=push + type=sha,event=push + type=ref,event=branch + type=ref,event=pr + ${{ inputs.meta-tags }} image-build: name: Build Image From a9f5f5dfaa89bddcd50442c2254acabec0a3d550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 06:08:08 -0600 Subject: [PATCH 076/125] wip --- .github/actions/buildx-bake/build/action.yml | 11 + .github/workflows/pull-request-callable.yml | 212 +++++++++++++++++-- 2 files changed, 211 insertions(+), 12 deletions(-) diff --git a/.github/actions/buildx-bake/build/action.yml b/.github/actions/buildx-bake/build/action.yml index a9fa7aa..fbab6bb 100644 --- a/.github/actions/buildx-bake/build/action.yml +++ b/.github/actions/buildx-bake/build/action.yml @@ -21,6 +21,11 @@ inputs: description: 'Container registry + image prefix' required: false type: string + free-disk-space: + description: 'Free disk space before build' + required: false + default: false + type: boolean runs: using: "composite" steps: @@ -49,6 +54,12 @@ runs: - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@v1.3.1 + if: ${{ inputs.free-disk-space == true }} + with: + tool-cache: true + - name: Build & push images id: bake uses: docker/bake-action@v6 diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index c0c7052..662b16b 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -7,6 +7,49 @@ on: description: 'Password or token for registry login' required: true inputs: + previous-version: + description: 'The strategy to detect the previous version: auto, from-tag, from-file or manual' + required: false + default: 'auto' + type: string + next-version: + description: 'The strategy to calculate the next version: auto, semantic, from-file, increment or manual' + required: false + default: 'auto' + type: string + output-format: + description: 'The output format of the next version' + required: false + default: '{{.Major}}.{{.Minor}}.{{.Patch}}-pull-request' + type: string + version-file: + description: 'Set version in file named as input' + required: false + type: string + version-makefile: + description: 'Set version in makefile named as input' + required: false + type: string + version-justfile: + description: 'Set version in justfile named as input' + required: false + type: string + version-package: + description: 'Set version in package json named as input' + required: false + type: string + version-package-lock: + description: 'Set version in package lock named as input' + required: false + type: string + version-script: + description: 'Set version in script named as input' + required: false + type: string + version-chart: + description: 'Set version in chart named as input' + required: false + type: string registry-image: description: 'Container registry + image prefix (e.g. ghcr.io/org/repo)' required: false @@ -43,24 +86,161 @@ on: required: false type: string default: 'ghcr.io' + free-disk-space: + description: 'Free disk space before build' + required: false + default: false + type: boolean + version-command: + description: 'The command to run for setting the version' + required: false + type: string + prepare-command: + description: 'The command to run for preparing the build' + required: false + type: string + lint-command: + description: 'The command to run for linting' + required: false + type: string + checks-command: + description: 'The command to run for checks' + required: false + type: string + just-install: + description: 'Install just' + required: false + default: false + type: boolean + just-version: + description: 'The version of just to install' + required: false + default: '1.35.0' + type: string permissions: contents: read packages: write jobs: - image-prepare: - name: Prepare Image Build + version: + name: Versioning runs-on: ${{ inputs.runner-default }} outputs: - matrix: ${{ steps.prepare.outputs.matrix }} + version: ${{ steps.set_version.outputs.version }} steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 fetch-tags: true + - name: Next release version + id: release_version + uses: getdevopspro/github-actions/release-version@v0.3.0-prerelease + with: + previous-version: ${{ inputs.previous-version }} + next-version: ${{ inputs.next-version }} + output-format: ${{ inputs.output-format }} + + - name: Set version in file + uses: getdevopspro/github-actions/version-file@v0.3.0-prerelease + with: + version: ${{ steps.release_version.outputs.version }} + version-makefile: ${{ inputs.version-makefile }} + version-justfile: ${{ inputs.version-justfile }} + version-package: ${{ inputs.version-package }} + version-package-lock: ${{ inputs.version-package-lock }} + version-script: ${{ inputs.version-script }} + version-chart: ${{ inputs.version-chart }} + + - name: Install just + if: inputs.just-install + uses: extractions/setup-just@v2 + with: + just-version: ${{ inputs.just-version }} + + - name: Run version command + if: inputs.version-command != '' + id: version_command + shell: bash + run: ${{ inputs.version-command }} + + - name: Upload updated source + uses: actions/upload-artifact@v3 + with: + name: updated-source + path: . + if-no-files-found: error + retention-days: 1 + include-hidden-files: true + + pre-build-commands: + name: Pre-Build Steps + runs-on: ${{ inputs.runner-default }} + strategy: + matrix: + pre-steps: + - command: lint + if: ${{ inputs.lint-command != '' }} + - command: checks + if: ${{ inputs.checks-command != '' }} + steps: + - name: Download updated source + uses: actions/download-artifact@v4 + with: + name: updated-source + + - name: Install just + if: inputs.just-install + uses: extractions/setup-just@v2 + with: + just-version: ${{ inputs.just-version }} + + - name: Run lint command + if: inputs.lint-command != '' && matrix.pre-steps.command == 'lint' + id: lint_command + shell: bash + run: ${{ inputs.lint-command }} + + - name: Run checks command + if: inputs.checks-command != '' && matrix.pre-steps.command == 'checks' + id: checks_command + shell: bash + run: ${{ inputs.checks-command }} + + - name: Upload updated source + uses: actions/upload-artifact@v3 + with: + name: updated-source + path: . + if-no-files-found: error + retention-days: 1 + include-hidden-files: true + + image-prepare: + name: Prepare Image Build + runs-on: ${{ inputs.runner-default }} + outputs: + matrix: ${{ steps.prepare.outputs.matrix }} + steps: + - name: Download updated source + uses: actions/download-artifact@v4 + with: + name: updated-source + + - name: Install just + if: inputs.just-install + uses: extractions/setup-just@v2 + with: + just-version: ${{ inputs.just-version }} + + - name: Run prepare command + if: inputs.prepare-command != '' + id: prepare_command + shell: bash + run: ${{ inputs.prepare-command }} + - name: Prepare matrix & metadata id: prepare uses: ./.github/actions/buildx-bake/prepare @@ -76,6 +256,15 @@ jobs: type=ref,event=pr ${{ inputs.meta-tags }} + - name: Upload updated source + uses: actions/upload-artifact@v3 + with: + name: updated-source + path: . + if-no-files-found: error + retention-days: 1 + include-hidden-files: true + image-build: name: Build Image needs: image-prepare @@ -84,11 +273,10 @@ jobs: matrix: platform: ${{ fromJson(needs.image-prepare.outputs.matrix) }} steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Download updated source + uses: actions/download-artifact@v4 with: - fetch-depth: 0 - fetch-tags: true + name: updated-source - uses: ./.github/actions/buildx-bake/build with: @@ -97,17 +285,17 @@ jobs: registry-image: ${{ inputs.registry-image }} registry-username: ${{ inputs.registry-username }} registry-password: ${{ secrets.registry-password }} + free-disk-space: ${{ inputs.free-disk-space }} image-merge: name: Push Image needs: image-build runs-on: ${{ inputs.runner-default }} steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Download updated source + uses: actions/download-artifact@v4 with: - fetch-depth: 0 - fetch-tags: true + name: updated-source - uses: ./.github/actions/buildx-bake/merge with: From 2b079f76dc677dcec2d9f3e569c604dad8e36549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 06:09:27 -0600 Subject: [PATCH 077/125] wip --- .github/workflows/pull-request-callable.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 662b16b..341b486 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -177,6 +177,7 @@ jobs: pre-build-commands: name: Pre-Build Steps + needs: version runs-on: ${{ inputs.runner-default }} strategy: matrix: @@ -220,6 +221,7 @@ jobs: image-prepare: name: Prepare Image Build + needs: pre-build-commands runs-on: ${{ inputs.runner-default }} outputs: matrix: ${{ steps.prepare.outputs.matrix }} From 1fd8a08cc991d5635779509d1771612191380c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 06:11:00 -0600 Subject: [PATCH 078/125] wip --- .github/workflows/pull-request-callable.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 341b486..498639f 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -167,7 +167,7 @@ jobs: run: ${{ inputs.version-command }} - name: Upload updated source - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: updated-source path: . @@ -211,7 +211,7 @@ jobs: run: ${{ inputs.checks-command }} - name: Upload updated source - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: updated-source path: . @@ -259,7 +259,7 @@ jobs: ${{ inputs.meta-tags }} - name: Upload updated source - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: updated-source path: . From e575df8f4159a207002f126360799d128eb06ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 06:13:39 -0600 Subject: [PATCH 079/125] wip --- .github/workflows/pull-request-callable.yml | 3 +++ .github/workflows/pull-request.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 498639f..2d14549 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -171,6 +171,7 @@ jobs: with: name: updated-source path: . + overwrite: true if-no-files-found: error retention-days: 1 include-hidden-files: true @@ -215,6 +216,7 @@ jobs: with: name: updated-source path: . + overwrite: true if-no-files-found: error retention-days: 1 include-hidden-files: true @@ -263,6 +265,7 @@ jobs: with: name: updated-source path: . + overwrite: true if-no-files-found: error retention-days: 1 include-hidden-files: true diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index a871b1f..4b90158 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -15,7 +15,7 @@ permissions: jobs: pr-build: uses: ./.github/workflows/pull-request-callable.yml - name: Build Image (Bake) + name: PR with: registry-image: '' bake-target: build From a5ae079685dd693f619d960b610f0486b706d730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 06:38:12 -0600 Subject: [PATCH 080/125] wip --- .github/workflows/pull-request-callable.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 2d14549..b2f7ccf 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -167,14 +167,13 @@ jobs: run: ${{ inputs.version-command }} - name: Upload updated source - uses: actions/upload-artifact@v4 + uses: eviden-actions/upload-artifact@v2 with: name: updated-source path: . overwrite: true if-no-files-found: error retention-days: 1 - include-hidden-files: true pre-build-commands: name: Pre-Build Steps @@ -189,7 +188,7 @@ jobs: if: ${{ inputs.checks-command != '' }} steps: - name: Download updated source - uses: actions/download-artifact@v4 + uses: eviden-actions/download-artifact@v2 with: name: updated-source @@ -229,7 +228,7 @@ jobs: matrix: ${{ steps.prepare.outputs.matrix }} steps: - name: Download updated source - uses: actions/download-artifact@v4 + uses: eviden-actions/download-artifact@v2 with: name: updated-source @@ -279,7 +278,7 @@ jobs: platform: ${{ fromJson(needs.image-prepare.outputs.matrix) }} steps: - name: Download updated source - uses: actions/download-artifact@v4 + uses: eviden-actions/download-artifact@v2 with: name: updated-source @@ -298,7 +297,7 @@ jobs: runs-on: ${{ inputs.runner-default }} steps: - name: Download updated source - uses: actions/download-artifact@v4 + uses: eviden-actions/download-artifact@v2 with: name: updated-source From c4a6b9a080ce341eefb48c9b9fb8e3d667f14d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 06:38:50 -0600 Subject: [PATCH 081/125] wip --- .github/workflows/pull-request-callable.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index b2f7ccf..c56d75a 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -210,16 +210,6 @@ jobs: shell: bash run: ${{ inputs.checks-command }} - - name: Upload updated source - uses: actions/upload-artifact@v4 - with: - name: updated-source - path: . - overwrite: true - if-no-files-found: error - retention-days: 1 - include-hidden-files: true - image-prepare: name: Prepare Image Build needs: pre-build-commands @@ -259,16 +249,6 @@ jobs: type=ref,event=pr ${{ inputs.meta-tags }} - - name: Upload updated source - uses: actions/upload-artifact@v4 - with: - name: updated-source - path: . - overwrite: true - if-no-files-found: error - retention-days: 1 - include-hidden-files: true - image-build: name: Build Image needs: image-prepare From 3717d56bd764a2abde798fdd55b07b8aaa6892fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 08:22:29 -0600 Subject: [PATCH 082/125] wip --- .github/actions/command/action.yml | 48 +++++ .github/workflows/pull-request-callable.yml | 209 +++++++++++++++++++- 2 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 .github/actions/command/action.yml diff --git a/.github/actions/command/action.yml b/.github/actions/command/action.yml new file mode 100644 index 0000000..6432cb1 --- /dev/null +++ b/.github/actions/command/action.yml @@ -0,0 +1,48 @@ +name: "Run Command & Upload Artifact" +description: "Composite action to run a command and upload its output as an artifact." +inputs: + command: + description: 'Command to run' + required: true + type: string + artifact-name: + description: 'Name of the composite action' + required: false + type: string + artifact-path: + description: 'Path to the artifact to upload' + required: false + type: string + artifact-overwrite: + description: 'Whether to overwrite the artifact if it already exists' + required: false + type: boolean + default: false + artifact-if-no-files-found: + description: 'Action to take if no files are found to upload' + required: false + type: string + default: 'warn' + artifact-retention-days: + description: 'Number of days to retain the artifact' + required: false + type: number + default: 30 + +runs: + using: "composite" + steps: + - name: Run command + id: run-command + shell: bash + run: "${{ inputs.command }}" + + - name: Upload command output as artifact + uses: eviden-actions/upload-artifact@v2 + if: inputs.artifact-name != '' && inputs.artifact-path != '' + with: + name: ${{ inputs.artifact-name }} + path: ${{ inputs.artifact-path }} + overwrite: ${{ inputs.artifact-overwrite }} + if-no-files-found: ${{ inputs.artifact-if-no-files-found }} + retention-days: ${{ inputs.artifact-retention-days }} diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index c56d75a..39842a2 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -1,4 +1,4 @@ -name: Pull Request Build +name: Pull Request on: workflow_call: @@ -117,6 +117,141 @@ on: required: false default: '1.35.0' type: string + test-command: + description: 'The command to run for testing' + required: false + type: string + test-artifact-name: + description: 'Name of the artifact to upload for test command' + required: false + type: string + test-artifact-path: + description: 'Path to the artifact to upload for test command' + required: false + type: string + test-artifact-overwrite: + description: 'Whether to overwrite the artifact if it already exists for test command' + required: false + type: boolean + default: false + test-artifact-if-no-files-found: + description: 'Action to take if no files are found to upload for test command' + required: false + type: string + default: 'warn' + test-artifact-retention-days: + description: 'Number of days to retain the artifact for test command' + required: false + type: number + default: 30 + test-unit-command: + description: 'The command to run for unit testing' + required: false + type: string + test-unit-artifact-name: + description: 'Name of the artifact to upload for unit test command' + required: false + type: string + test-unit-artifact-path: + description: 'Path to the artifact to upload for unit test command' + required: false + type: string + test-unit-artifact-overwrite: + description: 'Whether to overwrite the artifact if it already exists for unit test command' + required: false + type: boolean + default: false + test-unit-if-no-files-found: + description: 'Action to take if no files are found to upload for unit test command' + required: false + type: string + default: 'warn' + test-unit-retention-days: + description: 'Number of days to retain the artifact for unit test command' + required: false + type: number + default: 30 + test-integration-command: + description: 'The command to run for integration testing' + required: false + type: string + test-integration-artifact-name: + description: 'Name of the artifact to upload for integration test command' + required: false + type: string + test-integration-artifact-path: + description: 'Path to the artifact to upload for integration test command' + required: false + type: string + test-integration-artifact-overwrite: + description: 'Whether to overwrite the artifact if it already exists for integration test command' + required: false + type: boolean + default: false + test-integration-if-no-files-found: + description: 'Action to take if no files are found to upload for integration test command' + required: false + type: string + default: 'warn' + test-integration-retention-days: + description: 'Number of days to retain the artifact for integration test command' + required: false + type: number + default: 30 + test-e2e-command: + description: 'The command to run for end-to-end testing' + required: false + type: string + test-e2e-artifact-name: + description: 'Name of the artifact to upload for e2e test command' + required: false + type: string + test-e2e-artifact-path: + description: 'Path to the artifact to upload for e2e test command' + required: false + type: string + test-e2e-artifact-overwrite: + description: 'Whether to overwrite the artifact if it already exists for e2e test command' + required: false + type: boolean + default: false + test-e2e-if-no-files-found: + description: 'Action to take if no files are found to upload for e2e test command' + required: false + type: string + default: 'warn' + test-e2e-retention-days: + description: 'Number of days to retain the artifact for e2e test command' + required: false + type: number + default: 30 + test-coverage-command: + description: 'The command to run for test coverage' + required: false + type: string + test-coverage-artifact-name: + description: 'Name of the artifact to upload for test coverage command' + required: false + type: string + test-coverage-artifact-path: + description: 'Path to the artifact to upload for test coverage command' + required: false + type: string + test-coverage-artifact-overwrite: + description: 'Whether to overwrite the artifact if it already exists for test coverage command' + required: false + type: boolean + default: false + test-coverage-if-no-files-found: + description: 'Action to take if no files are found to upload for test coverage command' + required: false + type: string + default: 'warn' + test-coverage-retention-days: + description: 'Number of days to retain the artifact for test coverage command' + required: false + type: number + default: 30 permissions: contents: read @@ -285,3 +420,75 @@ jobs: with: registry-username: ${{ inputs.registry-username }} registry-password: ${{ secrets.registry-password }} + + post-build-commands: + name: Post-Build Steps + needs: image-merge + runs-on: ${{ inputs.runner-default }} + strategy: + matrix: + post-steps: + - if: ${{ inputs.test-command != '' }} + name: Test + command: ${{ inputs.test-command }} + artifact-name: ${{ inputs.test-artifact-name }} + artifact-path: ${{ inputs.test-artifact-path }} + artifact-overwrite: ${{ inputs.test-artifact-overwrite }} + artifact-if-no-files-found: ${{ inputs.test-artifact-if-no-files-found }} + artifact-retention-days: ${{ inputs.test-artifact-retention-days }} + - if: ${{ inputs.test-unit-command != '' }} + name: Unit Test + command: ${{ inputs.test-unit-command }} + artifact-name: ${{ inputs.test-unit-artifact-name }} + artifact-path: ${{ inputs.test-unit-artifact-path }} + artifact-overwrite: ${{ inputs.test-unit-artifact-overwrite }} + artifact-if-no-files-found: ${{ inputs.test-unit-artifact-if-no-files-found }} + artifact-retention-days: ${{ inputs.test-unit-artifact-retention-days }} + - if: ${{ inputs.test-integration-command != '' }} + name: Integration Test + command: ${{ inputs.test-integration-command }} + artifact-name: ${{ inputs.test-integration-artifact-name }} + artifact-path: ${{ inputs.test-integration-artifact-path }} + artifact-overwrite: ${{ inputs.test-integration-artifact-overwrite }} + artifact-if-no-files-found: ${{ inputs.test-integration-if-no-files-found }} + artifact-retention-days: ${{ inputs.test-integration-artifact-retention-days }} + - if: ${{ inputs.test-e2e-command != '' }} + name: E2E Test + command: ${{ inputs.test-e2e-command }} + artifact-name: ${{ inputs.test-e2e-artifact-name }} + artifact-path: ${{ inputs.test-e2e-artifact-path }} + artifact-overwrite: ${{ inputs.test-e2e-artifact-overwrite }} + artifact-if-no-files-found: ${{ inputs.test-e2e-if-no-files-found }} + artifact-retention-days: ${{ inputs.test-e2e-artifact-retention-days }} + - if: ${{ inputs.test-converage-command != '' }} + name: Test Coverage + command: ${{ inputs.test-coverage-command }} + artifact-name: ${{ inputs.test-coverage-artifact-name }} + artifact-path: ${{ inputs.test-coverage-artifact-path }} + artifact-overwrite: ${{ inputs.test-coverage-artifact-overwrite }} + artifact-if-no-files-found: ${{ inputs.test-coverage-if-no-files-found }} + artifact-retention-days: ${{ inputs.test-coverage-artifact-retention-days }} + - if: ${{ inputs.test-checks-command != '' }} + name: Test Checks + command: ${{ inputs.test-checks-command }} + artifact-name: ${{ inputs.test-checks-artifact-name }} + artifact-path: ${{ inputs.test-checks-artifact-path }} + artifact-overwrite: ${{ inputs.test-checks-artifact-overwrite }} + artifact-if-no-files-found: ${{ inputs.test-checks-if-no-files-found }} + artifact-retention-days: ${{ inputs.test-checks-artifact-retention-days }} + steps: + - name: Download updated source + uses: eviden-actions/download-artifact@v2 + with: + name: updated-source + + - name: ${{ matrix.post-steps.name }} + id: command + uses: ./.github/actions/command + with: + command: ${{ matrix.post-steps.command }} + artifact-name: ${{ matrix.post-steps.artifact-name }} + artifact-path: ${{ matrix.post-steps.artifact-path }} + artifact-overwrite: ${{ matrix.post-steps.artifact-overwrite }} + artifact-if-no-files-found: ${{ matrix.post-steps.artifact-if-no-files-found }} + artifact-retention-days: ${{ matrix.post-steps.artifact-retention-days }} From d184de02fd5db5debefeece10fc042fb304f1d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 08:33:21 -0600 Subject: [PATCH 083/125] wip --- .github/workflows/pull-request-callable.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 39842a2..8f8b25f 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -316,11 +316,7 @@ jobs: runs-on: ${{ inputs.runner-default }} strategy: matrix: - pre-steps: - - command: lint - if: ${{ inputs.lint-command != '' }} - - command: checks - if: ${{ inputs.checks-command != '' }} + pre-steps: [] steps: - name: Download updated source uses: eviden-actions/download-artifact@v2 From 2be9046c429213f776ebd08afb99d330bbfa1c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 08:34:01 -0600 Subject: [PATCH 084/125] wip --- .github/workflows/pull-request-callable.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 8f8b25f..bb3695e 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -315,8 +315,7 @@ jobs: needs: version runs-on: ${{ inputs.runner-default }} strategy: - matrix: - pre-steps: [] + matrix: {} steps: - name: Download updated source uses: eviden-actions/download-artifact@v2 From f0752685dcee5c1438034052bb54c8b55920f94b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 11:44:38 -0600 Subject: [PATCH 085/125] wip --- .github/workflows/pull-request-callable.yml | 41 +++++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index bb3695e..56073c4 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -263,6 +263,7 @@ jobs: runs-on: ${{ inputs.runner-default }} outputs: version: ${{ steps.set_version.outputs.version }} + pre-steps: ${{ steps.set_pre_matrix.outputs.matrix }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -301,6 +302,21 @@ jobs: shell: bash run: ${{ inputs.version-command }} + - name: Set pre-build-commands matrix + id: set_pre_matrix + shell: bash + run: | + MATRIX=$(jq -n --arg name "Lint" --arg cmd "${{ inputs.lint-command }}" \ + '[{name: $name, command: $cmd}]') + + if [[ -n "${{ inputs.checks-command }}" ]]; then + # Add checks step if command is provided + MATRIX=$(echo $MATRIX | jq --arg name "Checks" --arg cmd "${{ inputs.checks-command }}" \ + '. + [{name: $name, command: $cmd}]') + fi + + echo "matrix=$MATRIX" >> $GITHUB_OUTPUT + - name: Upload updated source uses: eviden-actions/upload-artifact@v2 with: @@ -315,7 +331,8 @@ jobs: needs: version runs-on: ${{ inputs.runner-default }} strategy: - matrix: {} + matrix: + pre-steps: ${{ fromJson(needs.version.outputs.pre_steps) }} steps: - name: Download updated source uses: eviden-actions/download-artifact@v2 @@ -328,17 +345,11 @@ jobs: with: just-version: ${{ inputs.just-version }} - - name: Run lint command - if: inputs.lint-command != '' && matrix.pre-steps.command == 'lint' - id: lint_command - shell: bash - run: ${{ inputs.lint-command }} - - - name: Run checks command - if: inputs.checks-command != '' && matrix.pre-steps.command == 'checks' - id: checks_command - shell: bash - run: ${{ inputs.checks-command }} + - name: ${{ matrix.pre-steps.name }} + id: command + uses: ./.github/actions/command + with: + command: ${{ matrix.pre-steps.command }} image-prepare: name: Prepare Image Build @@ -477,6 +488,12 @@ jobs: with: name: updated-source + - name: Install just + if: inputs.just-install + uses: extractions/setup-just@v2 + with: + just-version: ${{ inputs.just-version }} + - name: ${{ matrix.post-steps.name }} id: command uses: ./.github/actions/command From 0e5fde6ac6f1ed6ed022cceeedcdeaefd0f0278a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 11:55:33 -0600 Subject: [PATCH 086/125] wip --- .github/workflows/pull-request-callable.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 56073c4..8596792 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -302,20 +302,20 @@ jobs: shell: bash run: ${{ inputs.version-command }} - - name: Set pre-build-commands matrix + - name: Set pre-steps matrix id: set_pre_matrix shell: bash run: | - MATRIX=$(jq -n --arg name "Lint" --arg cmd "${{ inputs.lint-command }}" \ + MATRIX=$(jq -cn --arg name "Lint" --arg cmd "${{ inputs.lint-command }}" \ '[{name: $name, command: $cmd}]') if [[ -n "${{ inputs.checks-command }}" ]]; then # Add checks step if command is provided - MATRIX=$(echo $MATRIX | jq --arg name "Checks" --arg cmd "${{ inputs.checks-command }}" \ + MATRIX=$(echo $MATRIX | jq -c --arg name "Checks" --arg cmd "${{ inputs.checks-command }}" \ '. + [{name: $name, command: $cmd}]') fi - echo "matrix=$MATRIX" >> $GITHUB_OUTPUT + echo "matrix=$MATRIX" >>${GITHUB_OUTPUT} - name: Upload updated source uses: eviden-actions/upload-artifact@v2 @@ -326,7 +326,7 @@ jobs: if-no-files-found: error retention-days: 1 - pre-build-commands: + pre-steps: name: Pre-Build Steps needs: version runs-on: ${{ inputs.runner-default }} @@ -353,7 +353,7 @@ jobs: image-prepare: name: Prepare Image Build - needs: pre-build-commands + needs: pre-steps runs-on: ${{ inputs.runner-default }} outputs: matrix: ${{ steps.prepare.outputs.matrix }} @@ -427,7 +427,7 @@ jobs: registry-username: ${{ inputs.registry-username }} registry-password: ${{ secrets.registry-password }} - post-build-commands: + post-steps: name: Post-Build Steps needs: image-merge runs-on: ${{ inputs.runner-default }} From c77ba012791f5811805415a9d8ba3d4df65a377b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 11:57:34 -0600 Subject: [PATCH 087/125] wip --- .github/workflows/pull-request-callable.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 8596792..65a9f2a 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -308,15 +308,17 @@ jobs: run: | MATRIX=$(jq -cn --arg name "Lint" --arg cmd "${{ inputs.lint-command }}" \ '[{name: $name, command: $cmd}]') - if [[ -n "${{ inputs.checks-command }}" ]]; then # Add checks step if command is provided MATRIX=$(echo $MATRIX | jq -c --arg name "Checks" --arg cmd "${{ inputs.checks-command }}" \ '. + [{name: $name, command: $cmd}]') fi - echo "matrix=$MATRIX" >>${GITHUB_OUTPUT} + - name: Show pre-steps matrix + shell: bash + run: echo "${{ steps.set_pre_matrix.outputs.matrix }}" + - name: Upload updated source uses: eviden-actions/upload-artifact@v2 with: From 5bb089cdfb12c6b17e90e935b31e7f4a4b55c57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 11:59:20 -0600 Subject: [PATCH 088/125] wip --- .github/workflows/pull-request-callable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 65a9f2a..1eef705 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -334,7 +334,7 @@ jobs: runs-on: ${{ inputs.runner-default }} strategy: matrix: - pre-steps: ${{ fromJson(needs.version.outputs.pre_steps) }} + pre-steps: ${{ fromJson(needs.version.outputs.pre-steps) }} steps: - name: Download updated source uses: eviden-actions/download-artifact@v2 From 72ef36742bafe3bb99d46c09e0cc728ff79898f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 12:14:24 -0600 Subject: [PATCH 089/125] wip --- .github/workflows/pull-request-callable.yml | 101 +++++++++----------- 1 file changed, 47 insertions(+), 54 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 1eef705..e240441 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -264,6 +264,7 @@ jobs: outputs: version: ${{ steps.set_version.outputs.version }} pre-steps: ${{ steps.set_pre_matrix.outputs.matrix }} + post-steps: ${{ steps.set_post_matrix.outputs.matrix }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -306,12 +307,14 @@ jobs: id: set_pre_matrix shell: bash run: | - MATRIX=$(jq -cn --arg name "Lint" --arg cmd "${{ inputs.lint-command }}" \ - '[{name: $name, command: $cmd}]') - if [[ -n "${{ inputs.checks-command }}" ]]; then - # Add checks step if command is provided - MATRIX=$(echo $MATRIX | jq -c --arg name "Checks" --arg cmd "${{ inputs.checks-command }}" \ + MATRIX=[] + function jq_add_step { + MATRIX=$(echo $MATRIX | jq -c --arg name "$1" --arg cmd "$2" \ '. + [{name: $name, command: $cmd}]') + } + jq_add_step "Lint" "${{ inputs.lint-command }}" + if [[ -n "${{ inputs.checks-command }}" ]]; then + jq_add_step "Checks" "${{ inputs.checks-command }}" fi echo "matrix=$MATRIX" >>${GITHUB_OUTPUT} @@ -319,6 +322,44 @@ jobs: shell: bash run: echo "${{ steps.set_pre_matrix.outputs.matrix }}" + - name: Set post-steps matrix + id: set_post_matrix + shell: bash + run: | + MATRIX=[] + function jq_add_step { + MATRIX=$(echo $MATRIX | jq -c --arg name "$1" --arg cmd "$2" --arg artifact-name "$3" --arg artifact-path "$4" \ + --arg artifact-overwrite "$5" --arg artifact-if-no-files-found "$6" --arg artifact-retention-days "$7" \ + '. + [{name: $name, command: $cmd, artifact-name: $artifact-name, artifact-path: $artifact-path, artifact-overwrite: $artifact-overwrite, artifact-if-no-files-found: $artifact-if-no-files-found, artifact-retention-days: $artifact-retention-days}]') + } + jq_add_step "Test" "${{ inputs.test-command }}" "${{ inputs.test-artifact-name }}" "${{ inputs.test-artifact-path }}" \ + "${{ inputs.test-artifact-overwrite }}" "${{ inputs.test-artifact-if-no-files-found }}" "${{ inputs.test-artifact-retention-days }}" + if [[ -n "${{ inputs.test-unit-command }}" ]]; then + jq_add_step "Unit Test" "${{ inputs.test-unit-command }}" "${{ inputs.test-unit-artifact-name }}" "${{ inputs.test-unit-artifact-path }}" \ + "${{ inputs.test-unit-artifact-overwrite }}" "${{ inputs.test-unit-if-no-files-found }}" "${{ inputs.test-unit-retention-days }}" + fi + if [[ -n "${{ inputs.test-integration-command }}" ]]; then + jq_add_step "Integration Test" "${{ inputs.test-integration-command }}" "${{ inputs.test-integration-artifact-name }}" "${{ inputs.test-integration-artifact-path }}" \ + "${{ inputs.test-integration-artifact-overwrite }}" "${{ inputs.test-integration-if-no-files-found }}" "${{ inputs.test-integration-retention-days }}" + fi + if [[ -n "${{ inputs.test-e2e-command }}" ]]; then + jq_add_step "E2E Test" "${{ inputs.test-e2e-command }}" "${{ inputs.test-e2e-artifact-name }}" "${{ inputs.test-e2e-artifact-path }}" \ + "${{ inputs.test-e2e-artifact-overwrite }}" "${{ inputs.test-e2e-if-no-files-found }}" "${{ inputs.test-e2e-retention-days }}" + fi + if [[ -n "${{ inputs.test-coverage-command }}" ]]; then + jq_add_step "Test Coverage" "${{ inputs.test-coverage-command }}" "${{ inputs.test-coverage-artifact-name }}" "${{ inputs.test-coverage-artifact-path }}" \ + "${{ inputs.test-coverage-artifact-overwrite }}" "${{ inputs.test-coverage-if-no-files-found }}" "${{ inputs.test-coverage-retention-days }}" + fi + if [[ -n "${{ inputs.test-checks-command }}" ]]; then + jq_add_step "Test Checks" "${{ inputs.test-checks-command }}" "${{ inputs.test-checks-artifact-name }}" "${{ inputs.test-checks-artifact-path }}" \ + "${{ inputs.test-checks-artifact-overwrite }}" "${{ inputs.test-checks-if-no-files-found }}" "${{ inputs.test-checks-retention-days }}" + fi + echo "matrix=$MATRIX" >>${GITHUB_OUTPUT} + + - name: Show post-steps matrix + shell: bash + run: echo "${{ steps.set_post_matrix.outputs.matrix }}" + - name: Upload updated source uses: eviden-actions/upload-artifact@v2 with: @@ -435,55 +476,7 @@ jobs: runs-on: ${{ inputs.runner-default }} strategy: matrix: - post-steps: - - if: ${{ inputs.test-command != '' }} - name: Test - command: ${{ inputs.test-command }} - artifact-name: ${{ inputs.test-artifact-name }} - artifact-path: ${{ inputs.test-artifact-path }} - artifact-overwrite: ${{ inputs.test-artifact-overwrite }} - artifact-if-no-files-found: ${{ inputs.test-artifact-if-no-files-found }} - artifact-retention-days: ${{ inputs.test-artifact-retention-days }} - - if: ${{ inputs.test-unit-command != '' }} - name: Unit Test - command: ${{ inputs.test-unit-command }} - artifact-name: ${{ inputs.test-unit-artifact-name }} - artifact-path: ${{ inputs.test-unit-artifact-path }} - artifact-overwrite: ${{ inputs.test-unit-artifact-overwrite }} - artifact-if-no-files-found: ${{ inputs.test-unit-artifact-if-no-files-found }} - artifact-retention-days: ${{ inputs.test-unit-artifact-retention-days }} - - if: ${{ inputs.test-integration-command != '' }} - name: Integration Test - command: ${{ inputs.test-integration-command }} - artifact-name: ${{ inputs.test-integration-artifact-name }} - artifact-path: ${{ inputs.test-integration-artifact-path }} - artifact-overwrite: ${{ inputs.test-integration-artifact-overwrite }} - artifact-if-no-files-found: ${{ inputs.test-integration-if-no-files-found }} - artifact-retention-days: ${{ inputs.test-integration-artifact-retention-days }} - - if: ${{ inputs.test-e2e-command != '' }} - name: E2E Test - command: ${{ inputs.test-e2e-command }} - artifact-name: ${{ inputs.test-e2e-artifact-name }} - artifact-path: ${{ inputs.test-e2e-artifact-path }} - artifact-overwrite: ${{ inputs.test-e2e-artifact-overwrite }} - artifact-if-no-files-found: ${{ inputs.test-e2e-if-no-files-found }} - artifact-retention-days: ${{ inputs.test-e2e-artifact-retention-days }} - - if: ${{ inputs.test-converage-command != '' }} - name: Test Coverage - command: ${{ inputs.test-coverage-command }} - artifact-name: ${{ inputs.test-coverage-artifact-name }} - artifact-path: ${{ inputs.test-coverage-artifact-path }} - artifact-overwrite: ${{ inputs.test-coverage-artifact-overwrite }} - artifact-if-no-files-found: ${{ inputs.test-coverage-if-no-files-found }} - artifact-retention-days: ${{ inputs.test-coverage-artifact-retention-days }} - - if: ${{ inputs.test-checks-command != '' }} - name: Test Checks - command: ${{ inputs.test-checks-command }} - artifact-name: ${{ inputs.test-checks-artifact-name }} - artifact-path: ${{ inputs.test-checks-artifact-path }} - artifact-overwrite: ${{ inputs.test-checks-artifact-overwrite }} - artifact-if-no-files-found: ${{ inputs.test-checks-if-no-files-found }} - artifact-retention-days: ${{ inputs.test-checks-artifact-retention-days }} + post-steps: ${{ fromJson(needs.version.outputs.post-steps) }} steps: - name: Download updated source uses: eviden-actions/download-artifact@v2 From ef5c0cd767492e6b36fc2a6469976aea4959e1e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 12:18:23 -0600 Subject: [PATCH 090/125] wip --- .github/workflows/pull-request-callable.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index e240441..b139f8a 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -328,9 +328,9 @@ jobs: run: | MATRIX=[] function jq_add_step { - MATRIX=$(echo $MATRIX | jq -c --arg name "$1" --arg cmd "$2" --arg artifact-name "$3" --arg artifact-path "$4" \ - --arg artifact-overwrite "$5" --arg artifact-if-no-files-found "$6" --arg artifact-retention-days "$7" \ - '. + [{name: $name, command: $cmd, artifact-name: $artifact-name, artifact-path: $artifact-path, artifact-overwrite: $artifact-overwrite, artifact-if-no-files-found: $artifact-if-no-files-found, artifact-retention-days: $artifact-retention-days}]') + MATRIX=$(echo $MATRIX | jq -c --arg name "$1" --arg cmd "$2" --arg artifact_name "$3" --arg artifact_path "$4" \ + --arg artifact_overwrite "$5" --arg artifact_if_no_files_found "$6" --arg artifact_retention_days "$7" \ + '. + [{name: $name, command: $cmd, artifact-name: $artifact_name, artifact-path: $artifact_path, artifact-overwrite: $artifact_overwrite, artifact-if-no-files-found: $artifact_if_no_files_found, artifact-retention-days: $artifact_retention_days}]') } jq_add_step "Test" "${{ inputs.test-command }}" "${{ inputs.test-artifact-name }}" "${{ inputs.test-artifact-path }}" \ "${{ inputs.test-artifact-overwrite }}" "${{ inputs.test-artifact-if-no-files-found }}" "${{ inputs.test-artifact-retention-days }}" From 0997aaa015bdfaef1114adb1b02942de0102a8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 12:23:05 -0600 Subject: [PATCH 091/125] wip --- .github/workflows/pull-request-callable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index b139f8a..1c2d5dc 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -330,7 +330,7 @@ jobs: function jq_add_step { MATRIX=$(echo $MATRIX | jq -c --arg name "$1" --arg cmd "$2" --arg artifact_name "$3" --arg artifact_path "$4" \ --arg artifact_overwrite "$5" --arg artifact_if_no_files_found "$6" --arg artifact_retention_days "$7" \ - '. + [{name: $name, command: $cmd, artifact-name: $artifact_name, artifact-path: $artifact_path, artifact-overwrite: $artifact_overwrite, artifact-if-no-files-found: $artifact_if_no_files_found, artifact-retention-days: $artifact_retention_days}]') + '. + [{name: $name, command: $cmd, artifact_name: $artifact_name, artifact_path: $artifact_path, artifact_overwrite: $artifact_overwrite, artifact_if_no_files_found: $artifact_if_no_files_found, artifact_retention_days: $artifact_retention_days}]') } jq_add_step "Test" "${{ inputs.test-command }}" "${{ inputs.test-artifact-name }}" "${{ inputs.test-artifact-path }}" \ "${{ inputs.test-artifact-overwrite }}" "${{ inputs.test-artifact-if-no-files-found }}" "${{ inputs.test-artifact-retention-days }}" From 90517bec77404d63a59961c598d3079fe91ec64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 12:30:47 -0600 Subject: [PATCH 092/125] wip --- .github/workflows/pull-request-callable.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 1c2d5dc..06f7d68 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -263,8 +263,8 @@ jobs: runs-on: ${{ inputs.runner-default }} outputs: version: ${{ steps.set_version.outputs.version }} - pre-steps: ${{ steps.set_pre_matrix.outputs.matrix }} - post-steps: ${{ steps.set_post_matrix.outputs.matrix }} + pre-step-matrix: ${{ steps.set_pre_matrix.outputs.matrix }} + post-steps-matrix: ${{ steps.set_post_matrix.outputs.matrix }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -330,7 +330,7 @@ jobs: function jq_add_step { MATRIX=$(echo $MATRIX | jq -c --arg name "$1" --arg cmd "$2" --arg artifact_name "$3" --arg artifact_path "$4" \ --arg artifact_overwrite "$5" --arg artifact_if_no_files_found "$6" --arg artifact_retention_days "$7" \ - '. + [{name: $name, command: $cmd, artifact_name: $artifact_name, artifact_path: $artifact_path, artifact_overwrite: $artifact_overwrite, artifact_if_no_files_found: $artifact_if_no_files_found, artifact_retention_days: $artifact_retention_days}]') + '. + [{name: $name, command: $cmd, artifact-name: $artifact_name, artifact-path: $artifact_path, artifact-overwrite: $artifact_overwrite, artifact-if-no-files-found: $artifact_if_no_files_found, artifact-retention-days: $artifact_retention_days}]') } jq_add_step "Test" "${{ inputs.test-command }}" "${{ inputs.test-artifact-name }}" "${{ inputs.test-artifact-path }}" \ "${{ inputs.test-artifact-overwrite }}" "${{ inputs.test-artifact-if-no-files-found }}" "${{ inputs.test-artifact-retention-days }}" @@ -375,7 +375,7 @@ jobs: runs-on: ${{ inputs.runner-default }} strategy: matrix: - pre-steps: ${{ fromJson(needs.version.outputs.pre-steps) }} + pre-steps: ${{ fromJson(needs.version.outputs.pre-steps-matrix) }} steps: - name: Download updated source uses: eviden-actions/download-artifact@v2 @@ -476,7 +476,7 @@ jobs: runs-on: ${{ inputs.runner-default }} strategy: matrix: - post-steps: ${{ fromJson(needs.version.outputs.post-steps) }} + post-steps: ${{ fromJson(needs.version.outputs.post-steps-matrix) }} steps: - name: Download updated source uses: eviden-actions/download-artifact@v2 From cef3d85d8c76a52e99ceb731d7ea4ce9ebd7da17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 12:34:50 -0600 Subject: [PATCH 093/125] wip --- .github/workflows/pull-request-callable.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 06f7d68..d699d6e 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -310,7 +310,7 @@ jobs: MATRIX=[] function jq_add_step { MATRIX=$(echo $MATRIX | jq -c --arg name "$1" --arg cmd "$2" \ - '. + [{name: $name, command: $cmd}]') + '. + [{"name": $name, "command": $cmd}]') } jq_add_step "Lint" "${{ inputs.lint-command }}" if [[ -n "${{ inputs.checks-command }}" ]]; then @@ -330,7 +330,7 @@ jobs: function jq_add_step { MATRIX=$(echo $MATRIX | jq -c --arg name "$1" --arg cmd "$2" --arg artifact_name "$3" --arg artifact_path "$4" \ --arg artifact_overwrite "$5" --arg artifact_if_no_files_found "$6" --arg artifact_retention_days "$7" \ - '. + [{name: $name, command: $cmd, artifact-name: $artifact_name, artifact-path: $artifact_path, artifact-overwrite: $artifact_overwrite, artifact-if-no-files-found: $artifact_if_no_files_found, artifact-retention-days: $artifact_retention_days}]') + '. + [{"name": $name, "command": $cmd, "artifact-name": $artifact_name, "artifact-path": $artifact_path, "artifact-overwrite": $artifact_overwrite, "artifact-if-no-files-found": $artifact_if_no_files_found, "artifact-retention-days": $artifact_retention_days}]') } jq_add_step "Test" "${{ inputs.test-command }}" "${{ inputs.test-artifact-name }}" "${{ inputs.test-artifact-path }}" \ "${{ inputs.test-artifact-overwrite }}" "${{ inputs.test-artifact-if-no-files-found }}" "${{ inputs.test-artifact-retention-days }}" From ec0f6a9ff193192714edc389aac3dfc97904d7b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 12:40:22 -0600 Subject: [PATCH 094/125] wip --- .github/workflows/pull-request-callable.yml | 22 ++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index d699d6e..77ef3e9 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -258,13 +258,13 @@ permissions: packages: write jobs: - version: - name: Versioning + prepare: + name: Prepare Steps runs-on: ${{ inputs.runner-default }} outputs: version: ${{ steps.set_version.outputs.version }} pre-step-matrix: ${{ steps.set_pre_matrix.outputs.matrix }} - post-steps-matrix: ${{ steps.set_post_matrix.outputs.matrix }} + post-step-matrix: ${{ steps.set_post_matrix.outputs.matrix }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -312,7 +312,9 @@ jobs: MATRIX=$(echo $MATRIX | jq -c --arg name "$1" --arg cmd "$2" \ '. + [{"name": $name, "command": $cmd}]') } - jq_add_step "Lint" "${{ inputs.lint-command }}" + if [[ -n "${{ inputs.lint-command }}" ]]; then + jq_add_step "Lint" "${{ inputs.lint-command }}" + fi if [[ -n "${{ inputs.checks-command }}" ]]; then jq_add_step "Checks" "${{ inputs.checks-command }}" fi @@ -332,8 +334,10 @@ jobs: --arg artifact_overwrite "$5" --arg artifact_if_no_files_found "$6" --arg artifact_retention_days "$7" \ '. + [{"name": $name, "command": $cmd, "artifact-name": $artifact_name, "artifact-path": $artifact_path, "artifact-overwrite": $artifact_overwrite, "artifact-if-no-files-found": $artifact_if_no_files_found, "artifact-retention-days": $artifact_retention_days}]') } - jq_add_step "Test" "${{ inputs.test-command }}" "${{ inputs.test-artifact-name }}" "${{ inputs.test-artifact-path }}" \ - "${{ inputs.test-artifact-overwrite }}" "${{ inputs.test-artifact-if-no-files-found }}" "${{ inputs.test-artifact-retention-days }}" + if [[ -n "${{ inputs.build-command }}" ]]; then + jq_add_step "Build" "${{ inputs.build-command }}" "${{ inputs.build-artifact-name }}" "${{ inputs.build-artifact-path }}" \ + "${{ inputs.build-artifact-overwrite }}" "${{ inputs.build-if-no-files-found }}" "${{ inputs.build-retention-days }}" + fi if [[ -n "${{ inputs.test-unit-command }}" ]]; then jq_add_step "Unit Test" "${{ inputs.test-unit-command }}" "${{ inputs.test-unit-artifact-name }}" "${{ inputs.test-unit-artifact-path }}" \ "${{ inputs.test-unit-artifact-overwrite }}" "${{ inputs.test-unit-if-no-files-found }}" "${{ inputs.test-unit-retention-days }}" @@ -371,11 +375,11 @@ jobs: pre-steps: name: Pre-Build Steps - needs: version + needs: prepare runs-on: ${{ inputs.runner-default }} strategy: matrix: - pre-steps: ${{ fromJson(needs.version.outputs.pre-steps-matrix) }} + pre-steps: ${{ fromJson(needs.prepare.outputs.pre-step-matrix) }} steps: - name: Download updated source uses: eviden-actions/download-artifact@v2 @@ -476,7 +480,7 @@ jobs: runs-on: ${{ inputs.runner-default }} strategy: matrix: - post-steps: ${{ fromJson(needs.version.outputs.post-steps-matrix) }} + post-steps: ${{ fromJson(needs.prepare.outputs.post-step-matrix) }} steps: - name: Download updated source uses: eviden-actions/download-artifact@v2 From dc971b3a8cd01b693208c4e483e7299bc6f824fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 12:41:51 -0600 Subject: [PATCH 095/125] wip --- .github/workflows/pull-request-callable.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 77ef3e9..2a8447b 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -376,6 +376,7 @@ jobs: pre-steps: name: Pre-Build Steps needs: prepare + if: ${{ fromJson(needs.prepare.outputs.pre-step-matrix) != '[]' }} runs-on: ${{ inputs.runner-default }} strategy: matrix: @@ -477,6 +478,7 @@ jobs: post-steps: name: Post-Build Steps needs: image-merge + if: ${{ fromJson(needs.prepare.outputs.post-step-matrix) != '[]' }} runs-on: ${{ inputs.runner-default }} strategy: matrix: From 7e271cd32425dcee874e96c3da242383efcd2142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 12:43:43 -0600 Subject: [PATCH 096/125] wip --- .github/workflows/pull-request-callable.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 2a8447b..76eab84 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -376,7 +376,7 @@ jobs: pre-steps: name: Pre-Build Steps needs: prepare - if: ${{ fromJson(needs.prepare.outputs.pre-step-matrix) != '[]' }} + if: ${{ fromJson(needs.prepare.outputs.pre-step-matrix) != '[]' && needs.prepare.outputs.pre-step-matrix != '' }} runs-on: ${{ inputs.runner-default }} strategy: matrix: @@ -478,7 +478,7 @@ jobs: post-steps: name: Post-Build Steps needs: image-merge - if: ${{ fromJson(needs.prepare.outputs.post-step-matrix) != '[]' }} + if: ${{ fromJson(needs.prepare.outputs.post-step-matrix) != '[]' && needs.prepare.outputs.post-step-matrix != '' }} runs-on: ${{ inputs.runner-default }} strategy: matrix: From 46d6e9478c0940ab9b1f8f78995d81dbe0c08d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 12:47:26 -0600 Subject: [PATCH 097/125] wip --- .github/workflows/pull-request-callable.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 76eab84..ce87e36 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -376,7 +376,7 @@ jobs: pre-steps: name: Pre-Build Steps needs: prepare - if: ${{ fromJson(needs.prepare.outputs.pre-step-matrix) != '[]' && needs.prepare.outputs.pre-step-matrix != '' }} + if: ${{ needs.prepare.outputs.pre-step-matrix != '' && toJson(fromJson(needs.prepare.outputs.pre-step-matrix) != '[]' }} runs-on: ${{ inputs.runner-default }} strategy: matrix: @@ -478,7 +478,7 @@ jobs: post-steps: name: Post-Build Steps needs: image-merge - if: ${{ fromJson(needs.prepare.outputs.post-step-matrix) != '[]' && needs.prepare.outputs.post-step-matrix != '' }} + if: ${{ needs.prepare.outputs.post-step-matrix != '' && toJson(fromJson(needs.prepare.outputs.post-step-matrix) != '[]' }} runs-on: ${{ inputs.runner-default }} strategy: matrix: From cbf8485a0bce761c6f8dbcb4ceb994541f2356af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 12:49:41 -0600 Subject: [PATCH 098/125] wip --- .github/workflows/pull-request-callable.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index ce87e36..7960db5 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -376,7 +376,7 @@ jobs: pre-steps: name: Pre-Build Steps needs: prepare - if: ${{ needs.prepare.outputs.pre-step-matrix != '' && toJson(fromJson(needs.prepare.outputs.pre-step-matrix) != '[]' }} + if: ${{ needs.prepare.outputs.pre-step-matrix != '' && toJson(fromJson(needs.prepare.outputs.pre-step-matrix)) != '[]' }} runs-on: ${{ inputs.runner-default }} strategy: matrix: @@ -478,7 +478,7 @@ jobs: post-steps: name: Post-Build Steps needs: image-merge - if: ${{ needs.prepare.outputs.post-step-matrix != '' && toJson(fromJson(needs.prepare.outputs.post-step-matrix) != '[]' }} + if: ${{ needs.prepare.outputs.post-step-matrix != '' && toJson(fromJson(needs.prepare.outputs.post-step-matrix)) != '[]' }} runs-on: ${{ inputs.runner-default }} strategy: matrix: From c2d6abc2fb33285e152adf51c0a0eb84cf0aa021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 14:28:41 -0600 Subject: [PATCH 099/125] wip --- .github/workflows/pull-request-callable.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 7960db5..3b9281d 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -402,6 +402,7 @@ jobs: image-prepare: name: Prepare Image Build needs: pre-steps + if: ${{ !cancelled() }} runs-on: ${{ inputs.runner-default }} outputs: matrix: ${{ steps.prepare.outputs.matrix }} From 86bb4778b40fc2067de682419e43982da914055c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 14:31:37 -0600 Subject: [PATCH 100/125] wip --- .github/workflows/pull-request-callable.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 3b9281d..d648cde 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -71,13 +71,18 @@ on: description: 'Username for registry login' required: true type: string - runner-arm64: - description: 'Runner label for ARM64 jobs' + runner-default: + description: 'Default runner' + required: false + type: string + default: 'ubuntu-22.04' + runner-build-arm64: + description: 'Runner for arm64 builds' required: false type: string default: 'ubuntu-22.04-arm' - runner-default: - description: 'Runner label for non‑ARM jobs' + runner-build-default: + description: 'Default runner for builds' required: false type: string default: 'ubuntu-22.04' @@ -442,7 +447,7 @@ jobs: image-build: name: Build Image needs: image-prepare - runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-arm64 || inputs.runner-default }} + runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-build-arm64 || inputs.runner-build-default }} strategy: matrix: platform: ${{ fromJson(needs.image-prepare.outputs.matrix) }} From 19fa9d84db57d9566ecf17bed283692060ee2791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 14:38:42 -0600 Subject: [PATCH 101/125] wip --- .github/workflows/pull-request-callable.yml | 75 +++++++-------------- 1 file changed, 24 insertions(+), 51 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index d648cde..7af2454 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -96,10 +96,6 @@ on: required: false default: false type: boolean - version-command: - description: 'The command to run for setting the version' - required: false - type: string prepare-command: description: 'The command to run for preparing the build' required: false @@ -270,6 +266,7 @@ jobs: version: ${{ steps.set_version.outputs.version }} pre-step-matrix: ${{ steps.set_pre_matrix.outputs.matrix }} post-step-matrix: ${{ steps.set_post_matrix.outputs.matrix }} + image-build-matrix: ${{ steps.prepare_image.outputs.matrix }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -302,12 +299,6 @@ jobs: with: just-version: ${{ inputs.just-version }} - - name: Run version command - if: inputs.version-command != '' - id: version_command - shell: bash - run: ${{ inputs.version-command }} - - name: Set pre-steps matrix id: set_pre_matrix shell: bash @@ -369,6 +360,27 @@ jobs: shell: bash run: echo "${{ steps.set_post_matrix.outputs.matrix }}" + - name: Prepare matrix & metadata + id: prepare_image + uses: ./.github/actions/buildx-bake/prepare + with: + bake-target: ${{ inputs.bake-target }} + registry-image: ${{ inputs.registry-image }} + meta-labels: + ${{ inputs.meta-labels }} + meta-tags: | + type=edge,branch=$repo.default_branch,event=push + type=sha,event=push + type=ref,event=branch + type=ref,event=pr + ${{ inputs.meta-tags }} + + - name: Run prepare command + if: inputs.prepare-command != '' + id: prepare_command + shell: bash + run: ${{ inputs.prepare-command }} + - name: Upload updated source uses: eviden-actions/upload-artifact@v2 with: @@ -404,53 +416,14 @@ jobs: with: command: ${{ matrix.pre-steps.command }} - image-prepare: - name: Prepare Image Build - needs: pre-steps - if: ${{ !cancelled() }} - runs-on: ${{ inputs.runner-default }} - outputs: - matrix: ${{ steps.prepare.outputs.matrix }} - steps: - - name: Download updated source - uses: eviden-actions/download-artifact@v2 - with: - name: updated-source - - - name: Install just - if: inputs.just-install - uses: extractions/setup-just@v2 - with: - just-version: ${{ inputs.just-version }} - - - name: Run prepare command - if: inputs.prepare-command != '' - id: prepare_command - shell: bash - run: ${{ inputs.prepare-command }} - - - name: Prepare matrix & metadata - id: prepare - uses: ./.github/actions/buildx-bake/prepare - with: - bake-target: ${{ inputs.bake-target }} - registry-image: ${{ inputs.registry-image }} - meta-labels: - ${{ inputs.meta-labels }} - meta-tags: | - type=edge,branch=$repo.default_branch,event=push - type=sha,event=push - type=ref,event=branch - type=ref,event=pr - ${{ inputs.meta-tags }} - image-build: name: Build Image needs: image-prepare + if: ${{ !cancelled() }} runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-build-arm64 || inputs.runner-build-default }} strategy: matrix: - platform: ${{ fromJson(needs.image-prepare.outputs.matrix) }} + platform: ${{ fromJson(needs.prepare.outputs.image-build-matrix) }} steps: - name: Download updated source uses: eviden-actions/download-artifact@v2 From cf4f7c4acdc6f9f86ea5ea67bc6073b2bbfd9f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 14:39:47 -0600 Subject: [PATCH 102/125] wip --- .github/workflows/pull-request-callable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 7af2454..db08b68 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -418,7 +418,7 @@ jobs: image-build: name: Build Image - needs: image-prepare + needs: prepare if: ${{ !cancelled() }} runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-build-arm64 || inputs.runner-build-default }} strategy: From 4e3f18a30d4d9340c44ee72f1be61a7b184c40cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 14:40:52 -0600 Subject: [PATCH 103/125] wip --- .github/workflows/pull-request-callable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index db08b68..b1029cc 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -418,7 +418,7 @@ jobs: image-build: name: Build Image - needs: prepare + needs: pre-steps if: ${{ !cancelled() }} runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-build-arm64 || inputs.runner-build-default }} strategy: From 75570a7f773cda9190f4848eef6c1b8a733ade3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 14:43:21 -0600 Subject: [PATCH 104/125] wip --- .github/workflows/pull-request-callable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index b1029cc..db08b68 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -418,7 +418,7 @@ jobs: image-build: name: Build Image - needs: pre-steps + needs: prepare if: ${{ !cancelled() }} runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-build-arm64 || inputs.runner-build-default }} strategy: From 44f486a52f7ee745a061caf241e1845cdeb031f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 14:45:06 -0600 Subject: [PATCH 105/125] wip --- .github/workflows/pull-request-callable.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index db08b68..f0b63ce 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -375,6 +375,10 @@ jobs: type=ref,event=pr ${{ inputs.meta-tags }} + - name: Show image build matrix + shell: bash + run: echo "${{ steps.prepare_image.outputs.matrix }}" + - name: Run prepare command if: inputs.prepare-command != '' id: prepare_command @@ -418,7 +422,7 @@ jobs: image-build: name: Build Image - needs: prepare + needs: pre-steps if: ${{ !cancelled() }} runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-build-arm64 || inputs.runner-build-default }} strategy: From a2d22943800f2f0cda486fcae99fea8ff59dd459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 14:52:09 -0600 Subject: [PATCH 106/125] wip --- .github/workflows/pull-request-callable.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index f0b63ce..c517125 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -420,6 +420,16 @@ jobs: with: command: ${{ matrix.pre-steps.command }} + temp: + name: Temporary Steps + needs: prepare + runs-on: ${{ inputs.runner-default }} + steps: + - name: Run prepare command + id: prepare_command + shell: bash + run: echo "${{ needs.prepare.outputs.image-build-matrix }}" + image-build: name: Build Image needs: pre-steps From ed68718e85a01dc47a32ced741cf69abe958d7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 14:56:46 -0600 Subject: [PATCH 107/125] wip --- .github/workflows/pull-request-callable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index c517125..43be7b5 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -433,7 +433,7 @@ jobs: image-build: name: Build Image needs: pre-steps - if: ${{ !cancelled() }} + if: ${{ !cancelled() && needs.prepare.outputs.image-build-matrix != '' && toJson(fromJson(needs.prepare.outputs.image-build-matrix)) != '[]' }} runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-build-arm64 || inputs.runner-build-default }} strategy: matrix: From c758345f0691c85793d53d279c79a4ca942650f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:03:43 -0600 Subject: [PATCH 108/125] wip --- .github/workflows/pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4b90158..3b97630 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -20,5 +20,6 @@ jobs: registry-image: '' bake-target: build registry-username: ${{ github.actor }} + lint-command: ls secrets: registry-password: ${{ secrets.GITHUB_TOKEN }} From 2dcd80143548740190c7d3b83b97bcef73e8d973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:05:42 -0600 Subject: [PATCH 109/125] wip --- .github/actions/buildx-bake/prepare/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/buildx-bake/prepare/action.yml b/.github/actions/buildx-bake/prepare/action.yml index d9e8eb5..c1f4542 100644 --- a/.github/actions/buildx-bake/prepare/action.yml +++ b/.github/actions/buildx-bake/prepare/action.yml @@ -29,7 +29,7 @@ runs: run: | echo "matrix=$(docker buildx bake ${{ inputs.bake-target }} \ --print | jq -cr '.target | to_entries | map(.value.platforms[]) | unique')" \ - >> $GITHUB_OUTPUT + >>${GITHUB_OUTPUT} - name: Show matrix shell: bash From 81872f02685aa93ef748e9fb2421d861efc74df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:07:35 -0600 Subject: [PATCH 110/125] wip --- .github/actions/buildx-bake/prepare/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/buildx-bake/prepare/action.yml b/.github/actions/buildx-bake/prepare/action.yml index c1f4542..9f01026 100644 --- a/.github/actions/buildx-bake/prepare/action.yml +++ b/.github/actions/buildx-bake/prepare/action.yml @@ -28,7 +28,7 @@ runs: shell: bash run: | echo "matrix=$(docker buildx bake ${{ inputs.bake-target }} \ - --print | jq -cr '.target | to_entries | map(.value.platforms[]) | unique')" \ + --print | jq -c '.target | to_entries | map(.value.platforms[]) | unique')" \ >>${GITHUB_OUTPUT} - name: Show matrix From ca977f93b93692dcee6675b42d5e0719fae9757b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:10:45 -0600 Subject: [PATCH 111/125] wip --- .github/actions/buildx-bake/prepare/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/buildx-bake/prepare/action.yml b/.github/actions/buildx-bake/prepare/action.yml index 9f01026..4bf0f2c 100644 --- a/.github/actions/buildx-bake/prepare/action.yml +++ b/.github/actions/buildx-bake/prepare/action.yml @@ -27,9 +27,9 @@ runs: id: platforms shell: bash run: | - echo "matrix=$(docker buildx bake ${{ inputs.bake-target }} \ - --print | jq -c '.target | to_entries | map(.value.platforms[]) | unique')" \ - >>${GITHUB_OUTPUT} + MATRIX=$(docker buildx bake ${{ inputs.bake-target }} \ + --print | jq -c '.target | to_entries | map(.value.platforms[]) | unique') + echo "matrix=$MATRIX" >>${GITHUB_OUTPUT} - name: Show matrix shell: bash From f504dff517ad8016167e94d08bbfccea151627a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:11:35 -0600 Subject: [PATCH 112/125] wip --- .github/workflows/pull-request-callable.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 43be7b5..d1170bb 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -425,8 +425,11 @@ jobs: needs: prepare runs-on: ${{ inputs.runner-default }} steps: - - name: Run prepare command - id: prepare_command + - name: Show Pre-Build Matrix + shell: bash + run: echo "${{ needs.prepare.outputs.pre-step-matrix }}" + + - name: Show Image Build Matrix shell: bash run: echo "${{ needs.prepare.outputs.image-build-matrix }}" From 34a5d04772ab76d20e08c50c7cf88142c6d4c735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:14:33 -0600 Subject: [PATCH 113/125] wip --- .github/workflows/pull-request-callable.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index d1170bb..8bef070 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -266,7 +266,7 @@ jobs: version: ${{ steps.set_version.outputs.version }} pre-step-matrix: ${{ steps.set_pre_matrix.outputs.matrix }} post-step-matrix: ${{ steps.set_post_matrix.outputs.matrix }} - image-build-matrix: ${{ steps.prepare_image.outputs.matrix }} + image-platform-matrix: ${{ steps.prepare_image.outputs.matrix }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -431,16 +431,16 @@ jobs: - name: Show Image Build Matrix shell: bash - run: echo "${{ needs.prepare.outputs.image-build-matrix }}" + run: echo "${{ needs.prepare.outputs.image-platform-matrix }}" image-build: name: Build Image needs: pre-steps - if: ${{ !cancelled() && needs.prepare.outputs.image-build-matrix != '' && toJson(fromJson(needs.prepare.outputs.image-build-matrix)) != '[]' }} + if: ${{ needs.prepare.outputs.image-platform-matrix != '' && toJson(fromJson(needs.prepare.outputs.image-platform-matrix)) != '[]' }} runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-build-arm64 || inputs.runner-build-default }} strategy: matrix: - platform: ${{ fromJson(needs.prepare.outputs.image-build-matrix) }} + platform: ${{ fromJson(needs.prepare.outputs.image-platform-matrix) }} steps: - name: Download updated source uses: eviden-actions/download-artifact@v2 From 73f4395ebe263e2e9ec5399178d66d44895412f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:15:50 -0600 Subject: [PATCH 114/125] wip --- .github/workflows/pull-request-callable.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 8bef070..9b764be 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -435,7 +435,9 @@ jobs: image-build: name: Build Image - needs: pre-steps + needs: + - prepare + - pre-steps if: ${{ needs.prepare.outputs.image-platform-matrix != '' && toJson(fromJson(needs.prepare.outputs.image-platform-matrix)) != '[]' }} runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-build-arm64 || inputs.runner-build-default }} strategy: From fa48a1a38c5f23097e7214aa0715e86e813a7db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:16:56 -0600 Subject: [PATCH 115/125] wip --- .github/workflows/pull-request.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 3b97630..4b90158 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -20,6 +20,5 @@ jobs: registry-image: '' bake-target: build registry-username: ${{ github.actor }} - lint-command: ls secrets: registry-password: ${{ secrets.GITHUB_TOKEN }} From c34d36ddbf22d49d3647d5e02c0d78660fc669e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:19:26 -0600 Subject: [PATCH 116/125] wip --- .github/workflows/pull-request-callable.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 9b764be..bb0c0da 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -397,7 +397,7 @@ jobs: pre-steps: name: Pre-Build Steps needs: prepare - if: ${{ needs.prepare.outputs.pre-step-matrix != '' && toJson(fromJson(needs.prepare.outputs.pre-step-matrix)) != '[]' }} + if: ${{ !cancelled() && needs.prepare.outputs.pre-step-matrix != '' && toJson(fromJson(needs.prepare.outputs.pre-step-matrix)) != '[]' }} runs-on: ${{ inputs.runner-default }} strategy: matrix: @@ -438,7 +438,7 @@ jobs: needs: - prepare - pre-steps - if: ${{ needs.prepare.outputs.image-platform-matrix != '' && toJson(fromJson(needs.prepare.outputs.image-platform-matrix)) != '[]' }} + if: ${{ !cancelled() && needs.prepare.outputs.image-platform-matrix != '' && toJson(fromJson(needs.prepare.outputs.image-platform-matrix)) != '[]' }} runs-on: ${{ matrix.platform == 'linux/arm64' && inputs.runner-build-arm64 || inputs.runner-build-default }} strategy: matrix: @@ -475,8 +475,10 @@ jobs: post-steps: name: Post-Build Steps - needs: image-merge - if: ${{ needs.prepare.outputs.post-step-matrix != '' && toJson(fromJson(needs.prepare.outputs.post-step-matrix)) != '[]' }} + needs: + - prepare + - image-merge + if: ${{ !cancelled() && needs.prepare.outputs.post-step-matrix != '' && toJson(fromJson(needs.prepare.outputs.post-step-matrix)) != '[]' }} runs-on: ${{ inputs.runner-default }} strategy: matrix: From b0be9f1d38d6bd86291abda919365ffc57d08ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:21:55 -0600 Subject: [PATCH 117/125] wip --- .github/workflows/pull-request-callable.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index bb0c0da..91c0d6e 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -420,19 +420,6 @@ jobs: with: command: ${{ matrix.pre-steps.command }} - temp: - name: Temporary Steps - needs: prepare - runs-on: ${{ inputs.runner-default }} - steps: - - name: Show Pre-Build Matrix - shell: bash - run: echo "${{ needs.prepare.outputs.pre-step-matrix }}" - - - name: Show Image Build Matrix - shell: bash - run: echo "${{ needs.prepare.outputs.image-platform-matrix }}" - image-build: name: Build Image needs: @@ -461,6 +448,7 @@ jobs: image-merge: name: Push Image needs: image-build + if: ${{ !cancelled() }} runs-on: ${{ inputs.runner-default }} steps: - name: Download updated source From e5874458a02804f7a2e6fac05f1da198534a7836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:23:43 -0600 Subject: [PATCH 118/125] wip --- .github/workflows/pull-request.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4b90158..9feb540 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -20,5 +20,7 @@ jobs: registry-image: '' bake-target: build registry-username: ${{ github.actor }} + lint-command: ls + test-command: ls secrets: registry-password: ${{ secrets.GITHUB_TOKEN }} From 42ca82c1fbae401c5a114791376b5a53a953e230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:28:49 -0600 Subject: [PATCH 119/125] wip --- .github/workflows/pull-request-callable.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 91c0d6e..80c501a 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -330,10 +330,11 @@ jobs: --arg artifact_overwrite "$5" --arg artifact_if_no_files_found "$6" --arg artifact_retention_days "$7" \ '. + [{"name": $name, "command": $cmd, "artifact-name": $artifact_name, "artifact-path": $artifact_path, "artifact-overwrite": $artifact_overwrite, "artifact-if-no-files-found": $artifact_if_no_files_found, "artifact-retention-days": $artifact_retention_days}]') } - if [[ -n "${{ inputs.build-command }}" ]]; then - jq_add_step "Build" "${{ inputs.build-command }}" "${{ inputs.build-artifact-name }}" "${{ inputs.build-artifact-path }}" \ - "${{ inputs.build-artifact-overwrite }}" "${{ inputs.build-if-no-files-found }}" "${{ inputs.build-retention-days }}" + if [[ -n "${{ inputs.test-command }}" ]]; then + jq_add_step "Test" "${{ inputs.test-command }}" "${{ inputs.test-artifact-name }}" "${{ inputs.test-artifact-path }}" \ + "${{ inputs.test-artifact-overwrite }}" "${{ inputs.test-artifact-if-no-files-found }}" "${{ inputs.test-artifact-retention-days }}" fi + if [[ -n "${{ inputs.test-unit-command }}" ]]; then jq_add_step "Unit Test" "${{ inputs.test-unit-command }}" "${{ inputs.test-unit-artifact-name }}" "${{ inputs.test-unit-artifact-path }}" \ "${{ inputs.test-unit-artifact-overwrite }}" "${{ inputs.test-unit-if-no-files-found }}" "${{ inputs.test-unit-retention-days }}" @@ -360,7 +361,7 @@ jobs: shell: bash run: echo "${{ steps.set_post_matrix.outputs.matrix }}" - - name: Prepare matrix & metadata + - name: Set image metadata and platform matrix id: prepare_image uses: ./.github/actions/buildx-bake/prepare with: From 86fd111910a1d769f705204beab7541a5a943989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 15:30:42 -0600 Subject: [PATCH 120/125] wip --- .github/workflows/pull-request.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9feb540..4b90158 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -20,7 +20,5 @@ jobs: registry-image: '' bake-target: build registry-username: ${{ github.actor }} - lint-command: ls - test-command: ls secrets: registry-password: ${{ secrets.GITHUB_TOKEN }} From e6dd858a6723284ebfde608e230b261750841c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 16:00:22 -0600 Subject: [PATCH 121/125] wip --- .github/workflows/pull-request-callable.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pull-request-callable.yml b/.github/workflows/pull-request-callable.yml index 80c501a..015286c 100644 --- a/.github/workflows/pull-request-callable.yml +++ b/.github/workflows/pull-request-callable.yml @@ -6,6 +6,10 @@ on: registry-password: description: 'Password or token for registry login' required: true + outputs: + version: + description: 'Detected or calculated version' + value: ${{ jobs.prepare.outputs.version }} inputs: previous-version: description: 'The strategy to detect the previous version: auto, from-tag, from-file or manual' From 2d88cdac8774ebebaf8835efdb8b91dbebfd8196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 23:21:02 -0600 Subject: [PATCH 122/125] wip --- .github/workflows/pull-request.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4b90158..02c97f6 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -13,12 +13,21 @@ permissions: packages: write jobs: - pr-build: - uses: ./.github/workflows/pull-request-callable.yml - name: PR - with: - registry-image: '' - bake-target: build - registry-username: ${{ github.actor }} - secrets: - registry-password: ${{ secrets.GITHUB_TOKEN }} + test: + steps: + - name: test + id: command + uses: getdevopspro/github-actions/command@v0.3.9 + with: + command: | + docker_image="ghcr.io/${{ github.repository }}:${{ github.event.pull_request.head.sha }}" + echo "docker run --rm ${docker_image,,} -- just system-test" + # pr-build: + # uses: ./.github/workflows/pull-request-callable.yml + # name: PR + # with: + # registry-image: '' + # bake-target: build + # registry-username: ${{ github.actor }} + # secrets: + # registry-password: ${{ secrets.GITHUB_TOKEN }} From 6c1c0906cdffe59b36c0672563ab7412c2521e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Mon, 28 Jul 2025 23:22:22 -0600 Subject: [PATCH 123/125] wip --- .github/workflows/pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 02c97f6..77ca61a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -14,6 +14,7 @@ permissions: jobs: test: + runs-on: ubuntu-latest steps: - name: test id: command From 2327e19c5daf2b7ccbeb0012d2ea9c12d0aac995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Tue, 29 Jul 2025 00:14:31 -0600 Subject: [PATCH 124/125] wip --- .github/workflows/pull-request.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 77ca61a..c1f3617 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -17,12 +17,29 @@ jobs: runs-on: ubuntu-latest steps: - name: test - id: command - uses: getdevopspro/github-actions/command@v0.3.9 - with: - command: | - docker_image="ghcr.io/${{ github.repository }}:${{ github.event.pull_request.head.sha }}" - echo "docker run --rm ${docker_image,,} -- just system-test" + id: test + shell: bash + run: | + MATRIX=[] + function jq_add_step { + MATRIX=$(echo $MATRIX | jq -c --arg name "$1" --arg cmd "$2" \ + '. + [{"name": $name, "command": $cmd}]') + } + jq_add_step "Lint" "ls ${command}" + + echo "matrix=$MATRIX" >>"${GITHUB_OUTPUT}" + + - name: show matrix + run: | + echo "MATRIX: ${{ steps.test.outputs.matrix }}" + echo "MATRIX JSON: ${{ toJson(steps.test.outputs.matrix) }}" + # - name: test + # id: command + # uses: getdevopspro/github-actions/command@v0.3.9 + # with: + # command: | + # docker_image="ghcr.io/${{ github.repository }}:${{ github.event.pull_request.head.sha }}" + # echo "docker run --rm $$${docker_image,,} -- just system-test" # pr-build: # uses: ./.github/workflows/pull-request-callable.yml # name: PR From 41e65cac5bc5cd9fa585421241f57ead73f15d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Job=20C=C3=A9spedes=20Ortiz?= Date: Tue, 29 Jul 2025 00:16:26 -0600 Subject: [PATCH 125/125] wip --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index c1f3617..e6a5c18 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -25,7 +25,7 @@ jobs: MATRIX=$(echo $MATRIX | jq -c --arg name "$1" --arg cmd "$2" \ '. + [{"name": $name, "command": $cmd}]') } - jq_add_step "Lint" "ls ${command}" + jq_add_step "Lint" 'ls ${command}' echo "matrix=$MATRIX" >>"${GITHUB_OUTPUT}"