From b22df32c146e5bef0a778184ed47ea29e27a0fff Mon Sep 17 00:00:00 2001 From: Ilyes512 Date: Mon, 9 Nov 2026 12:52:54 +0100 Subject: [PATCH] Remove the 3.x actions and build/merge workflows bake.yml replaces build-image, create-manifest, build.yml, merge.yml and the PHP and Go CLI shims: what to build now lives in the consumer's docker-bake.hcl. This also drops the deprecated PHP builder names (builder_nodejs, node) that merge-php.yml still tagged. Consumers that haven't migrated stay on 3.0.2. --- .github/workflows/build-go-cli.yml | 111 ------------------ .github/workflows/build-php.yml | 65 ----------- .github/workflows/build.yml | 106 ----------------- .github/workflows/merge-go-cli.yml | 106 ----------------- .github/workflows/merge-php.yml | 55 --------- .github/workflows/merge.yml | 97 ---------------- build-image/action.yml | 180 ----------------------------- create-manifest/action.yml | 100 ---------------- 8 files changed, 820 deletions(-) delete mode 100644 .github/workflows/build-go-cli.yml delete mode 100644 .github/workflows/build-php.yml delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/merge-go-cli.yml delete mode 100644 .github/workflows/merge-php.yml delete mode 100644 .github/workflows/merge.yml delete mode 100644 build-image/action.yml delete mode 100644 create-manifest/action.yml diff --git a/.github/workflows/build-go-cli.yml b/.github/workflows/build-go-cli.yml deleted file mode 100644 index a15980f..0000000 --- a/.github/workflows/build-go-cli.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: Build Go CLI Image - -on: - workflow_call: - inputs: - runs-on: - description: Runner name i.e. default runner "ubuntu-24.04" - type: string - required: true - platform: - description: Platform i.e. "linux/amd64", "linux/arm64" - type: string - required: true - image-name: - description: Image name - type: string - required: true - version: - description: >- - Version injected into the binary. Defaults, on a tag push, to the tag without its leading - "v" — the string GoReleaser injects, so an image never disagrees with the binary cut from - the same tag. Left empty on any other trigger, so the Dockerfile's own fallback stands. - type: string - required: false - version-build-arg: - description: >- - Name of the Dockerfile ARG the version is passed to, i.e. "SPECS_VERSION". The Dockerfile - owns the ldflag itself; there is no default because a wrong one fails silently and the - image reports its fallback version. - type: string - required: true - dockerfile: - description: Dockerfile path - type: string - default: Dockerfile - context: - description: Build context path - type: string - default: . - target: - description: >- - Name of the dockerfile target to publish. Omit to build the default (last) stage. The - consuming repository owns its stages and therefore its base image. - type: string - required: false - title: - description: Custom image title (overrides repository name) - type: string - required: false - description: - description: Custom image description (overrides repository description) - type: string - required: false - build-args: - description: Additional build-time variables (multiline "KEY=value") - type: string - required: false - secrets: - description: List of secrets to expose to the build - type: string - required: false - push: - description: >- - Push the image to the registry by digest ("true"/"false"). Defaults to pushing, except - for dependabot. - type: string - required: false - disable-apparmor: - description: Disable AppArmor for the build - type: boolean - default: false - -jobs: - - version: - name: Version - runs-on: ${{ inputs.runs-on }} - outputs: - value: ${{ steps.resolve.outputs.value }} - steps: - - id: resolve - env: - GIVEN: ${{ inputs.version }} - run: | - value="$GIVEN" - if [ -z "$value" ] && [ "$GITHUB_REF_TYPE" = tag ]; then - value="${GITHUB_REF_NAME#v}" - fi - echo "value=$value" >> "$GITHUB_OUTPUT" - - build: - needs: version - uses: ./.github/workflows/build.yml - with: - runs-on: ${{ inputs.runs-on }} - platform: ${{ inputs.platform }} - dockerfile: ${{ inputs.dockerfile }} - context: ${{ inputs.context }} - target: ${{ inputs.target }} - image-name: ${{ inputs.image-name }} - title: ${{ inputs.title }} - description: ${{ inputs.description }} - version: ${{ needs.version.outputs.value }} - secrets: ${{ inputs.secrets }} - push: ${{ inputs.push }} - disable-apparmor: ${{ inputs.disable-apparmor }} - # Omitted entirely when there is no version, rather than passed empty: - # an empty ARG would override the Dockerfile's fallback with nothing. - build-args: | - ${{ needs.version.outputs.value != '' && format('{0}={1}', inputs.version-build-arg, needs.version.outputs.value) || '' }} - ${{ inputs.build-args }} diff --git a/.github/workflows/build-php.yml b/.github/workflows/build-php.yml deleted file mode 100644 index 3dcea5d..0000000 --- a/.github/workflows/build-php.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Build PHP Images - -on: - workflow_call: - inputs: - runs-on: - description: Runner name i.e. default runner "ubuntu-24.04" - type: string - required: true - platform: - description: Platform i.e. "linux/amd64", "linux/arm64" - type: string - required: true - image-name: - description: Image name - type: string - required: true - dockerfile: - description: Dockerfile path - type: string - default: Dockerfile - title: - description: Custom image title (overrides repository name) - type: string - required: false - description: - description: Custom image description (overrides repository description) - type: string - required: false - secrets: - description: List of secrets to expose to the build - type: string - required: false - disable-apparmor: - description: Disable AppArmor for the build - type: boolean - default: false - -jobs: - - runtime: - uses: ./.github/workflows/build.yml - with: - runs-on: ${{ inputs.runs-on }} - platform: ${{ inputs.platform }} - dockerfile: ${{ inputs.dockerfile }} - target: runtime - image-name: ${{ inputs.image-name }} - title: ${{ inputs.title }} - description: ${{ inputs.description }} - secrets: ${{ inputs.secrets }} - disable-apparmor: ${{ inputs.disable-apparmor }} - - builder: - uses: ./.github/workflows/build.yml - with: - runs-on: ${{ inputs.runs-on }} - platform: ${{ inputs.platform }} - dockerfile: ${{ inputs.dockerfile }} - target: builder - image-name: ${{ inputs.image-name }}/builder - title: ${{ inputs.title }} - description: ${{ inputs.description }} - secrets: ${{ inputs.secrets }} - disable-apparmor: ${{ inputs.disable-apparmor }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index c5c52a1..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: Build Images - -on: - workflow_call: - inputs: - runs-on: - description: Runner name i.e. default runner "ubuntu-24.04" - type: string - required: true - platform: - description: Platform i.e. "linux/amd64", "linux/arm64" - type: string - required: true - image-name: - description: Image name - type: string - required: true - dockerfile: - description: Dockerfile path - type: string - default: Dockerfile - context: - description: Build context path - type: string - default: . - target: - description: Name of the dockerfile target. Omit to build the default (last) stage. - type: string - required: false - title: - description: Custom image title (overrides repository name) - type: string - required: false - description: - description: Custom image description (overrides repository description) - type: string - required: false - version: - description: >- - Value for org.opencontainers.image.version. Defaults to the version derived from the ref; - pass the same value as to merge.yml when that one uses raw-tags or flavor. - type: string - required: false - secrets: - description: List of secrets to expose to the build - type: string - required: false - build-args: - description: List of build-time variables (multiline "KEY=value") - type: string - required: false - push: - description: >- - Push the image to the registry by digest ("true"/"false"). Defaults to pushing, except - for dependabot. - type: string - required: false - disable-apparmor: - description: Disable AppArmor for the build - type: boolean - default: false - -jobs: - build: - name: Build Image${{ inputs.target && format(' ({0})', inputs.target) || '' }} - runs-on: ${{ inputs.runs-on }} - steps: - - - name: Checkout - uses: actions/checkout@v7 - - - name: Image name - id: image_name - uses: ASzc/change-string-case-action@v8 - with: - string: ${{ inputs.image-name }} - - - name: Log in to the Container registry - uses: docker/login-action@v4.8.0 - if: ${{ github.actor != 'dependabot[bot]' }} - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Disable AppArmor - if: ${{ inputs.disable-apparmor }} - uses: cisagov/action-disable-apparmor@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 - - - name: Build and Push by digest - uses: specsnl/github-actions/build-image@3.1.0 - with: - dockerfile: ${{ inputs.dockerfile }} - context: ${{ inputs.context }} - platform: ${{ inputs.platform }} - target: ${{ inputs.target }} - image-name: ${{ steps.image_name.outputs.lowercase }} - title: ${{ inputs.title }} - description: ${{ inputs.description }} - version: ${{ inputs.version }} - secrets: ${{ inputs.secrets }} - build-args: ${{ inputs.build-args }} - push: ${{ inputs.push }} diff --git a/.github/workflows/merge-go-cli.yml b/.github/workflows/merge-go-cli.yml deleted file mode 100644 index e18a74a..0000000 --- a/.github/workflows/merge-go-cli.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: Merge Go CLI images to manifest - -on: - workflow_call: - inputs: - runs-on: - description: Runner name i.e. default runner "ubuntu-24.04" - type: string - required: true - image-name: - description: Image name - type: string - required: true - target: - description: Name of the dockerfile target the digests were built from. - type: string - required: false - variant: - description: >- - Publish this build as a variant of the same image, i.e. "alpine" tags it as - ":1.2.3-alpine" plus a bare ":alpine". Omit for the primary variant. - type: string - required: false - version: - description: >- - Overrides org.opencontainers.image.version. Rarely needed — metadata-action already sets - that label to the version it computed, i.e. "1.2.3" for a "v1.2.3" tag. - type: string - required: false - title: - description: Custom image title (overrides repository name) - type: string - required: false - description: - description: Custom image description (overrides repository description) - type: string - required: false - latest: - description: >- - Move ":latest" (or ":") to this build. Only ever applies to a stable tag, never - to a prerelease such as "v1.2.0-rc.1". - type: boolean - default: true - raw-tag: - description: Raw tag value - type: string - default: latest - raw-tags: - description: Additional metadata-action tag directives (multiline), appended to the tags block - type: string - required: false - flavor: - description: >- - Additional metadata-action flavor directives (multiline), appended after the ones this - workflow sets, so they override them. - type: string - required: false - push: - description: >- - Create and push the manifest ("true"/"false"). Must match the build's push. Defaults to - pushing, except for dependabot. - type: string - required: false - -jobs: - - # Resolved the same way as build-go-cli.yml, so the index and the per-platform images carry the - # same org.opencontainers.image.version even when the variant suffix is set. - version: - name: Version - runs-on: ${{ inputs.runs-on }} - outputs: - value: ${{ steps.resolve.outputs.value }} - steps: - - id: resolve - env: - GIVEN: ${{ inputs.version }} - run: | - value="$GIVEN" - if [ -z "$value" ] && [ "$GITHUB_REF_TYPE" = tag ]; then - value="${GITHUB_REF_NAME#v}" - fi - echo "value=$value" >> "$GITHUB_OUTPUT" - - merge: - needs: version - uses: ./.github/workflows/merge.yml - with: - runs-on: ${{ inputs.runs-on }} - image-name: ${{ inputs.image-name }} - target: ${{ inputs.target }} - title: ${{ inputs.title }} - description: ${{ inputs.description }} - version: ${{ needs.version.outputs.value }} - raw-tag: ${{ inputs.raw-tag }} - push: ${{ inputs.push }} - flavor: | - latest=false - ${{ inputs.variant != '' && format('suffix=-{0},onlatest=true', inputs.variant) || '' }} - ${{ inputs.flavor }} - raw-tags: | - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.0.') }} - type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} - type=raw,value=${{ inputs.variant || 'latest' }},suffix=,enable=${{ inputs.latest && startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, '-') }} - ${{ inputs.raw-tags }} diff --git a/.github/workflows/merge-php.yml b/.github/workflows/merge-php.yml deleted file mode 100644 index 1c20e96..0000000 --- a/.github/workflows/merge-php.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Merge PHP images to manifest - -on: - workflow_call: - inputs: - runs-on: - description: Runner name i.e. default runner "ubuntu-24.04" - type: string - required: true - image-name: - description: Image name - type: string - required: true - title-runtime: - description: Custom image title for runtime (overrides repository name) - type: string - required: false - description-runtime: - description: Custom image description for runtime (overrides repository description) - type: string - required: false - title-builder: - description: Custom image title for builder (overrides repository name) - type: string - required: false - description-builder: - description: Custom image description for builder (overrides repository description) - type: string - required: false - raw-tag: - description: Raw tag value - type: string - default: latest - -jobs: - - runtime: - uses: ./.github/workflows/merge.yml - with: - runs-on: ${{ inputs.runs-on }} - target: runtime - image-name: ${{ inputs.image-name }} - title: ${{ inputs.title-runtime }} - description: ${{ inputs.description-runtime }} - raw-tag: ${{ inputs.raw-tag }} - - builder: - uses: ./.github/workflows/merge.yml - with: - runs-on: ${{ inputs.runs-on }} - target: builder - image-name: ${{ inputs.image-name }}/builder - title: ${{ inputs.title-builder }} - description: ${{ inputs.description-builder }} - raw-tag: ${{ inputs.raw-tag }} diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml deleted file mode 100644 index ef97752..0000000 --- a/.github/workflows/merge.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Merge images to manifest - -on: - workflow_call: - inputs: - runs-on: - description: Runner name i.e. default runner "ubuntu-24.04" - type: string - required: true - image-name: - description: Image name - type: string - required: true - target: - description: Name of the dockerfile target the digests were built from. - type: string - required: false - title: - description: Custom image title (overrides repository name) - type: string - required: false - description: - description: Custom image description (overrides repository description) - type: string - required: false - raw-tag: - description: Raw tag value - type: string - default: latest - raw-tags: - description: Additional metadata-action tag directives (multiline), forwarded to create-manifest - type: string - required: false - flavor: - description: metadata-action flavor directives (multiline), forwarded to create-manifest - type: string - required: false - version: - description: Value for org.opencontainers.image.version - type: string - required: false - push: - description: >- - Create and push the manifest ("true"/"false"). Must match the build's push. Defaults to - pushing, except for dependabot. - type: string - required: false - -jobs: - merge: - name: Merge Images${{ inputs.target && format(' ({0})', inputs.target) || '' }} - runs-on: ${{ inputs.runs-on }} - # Skipped per step rather than per job: a job skipped by its `if` reports under its raw, - # unevaluated name, so it never satisfies a required "Merge Images" check. - env: - PUSH: ${{ inputs.push || github.actor != 'dependabot[bot]' }} - steps: - - - name: Skip merge - if: ${{ env.PUSH != 'true' }} - run: echo "::notice::The images were built without pushing, so there are no digests to merge." - - - name: Checkout - if: ${{ env.PUSH == 'true' }} - uses: actions/checkout@v7 - - - name: Image name - id: image_name - if: ${{ env.PUSH == 'true' }} - uses: ASzc/change-string-case-action@v8 - with: - string: ${{ inputs.image-name }} - - - name: Log in to the Container registry - if: ${{ env.PUSH == 'true' }} - uses: docker/login-action@v4.8.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Docker Buildx - if: ${{ env.PUSH == 'true' }} - uses: docker/setup-buildx-action@v4 - - - name: Create Manifest - if: ${{ env.PUSH == 'true' }} - uses: specsnl/github-actions/create-manifest@3.1.0 - with: - image-name: ${{ steps.image_name.outputs.lowercase }} - target: ${{ inputs.target }} - raw-tags: ${{ inputs.raw-tags }} - flavor: ${{ inputs.flavor }} - raw-tag: ${{ inputs.raw-tag }} - version: ${{ inputs.version }} - title: ${{ inputs.title }} - description: ${{ inputs.description }} diff --git a/build-image/action.yml b/build-image/action.yml deleted file mode 100644 index efb2818..0000000 --- a/build-image/action.yml +++ /dev/null @@ -1,180 +0,0 @@ -name: Build Image -description: Build and push Docker image by digest - -inputs: - platform: - description: Platform i.e. "linux/amd64", "linux/arm64" - required: true - image-name: - description: Name of the image - required: true - dockerfile: - description: Dockerfile path - required: true - context: - description: Build context path - default: . - target: - description: Name of the dockerfile target - required: false - title: - description: Custom image title (overrides repository name) - required: false - description: - description: Custom image description (overrides repository description) - required: false - secrets: - description: List of secrets to expose to the build - required: false - build-args: - description: List of build-time variables (multiline "KEY=value") - required: false - push: - description: >- - Push the image to the registry by digest. Defaults to true, except for dependabot and when - load is enabled. - required: false - load: - description: >- - Load the built image into the local Docker daemon instead of pushing it by digest, so it can - be run in a later step. Only works for a single platform. - default: "false" - raw-tag: - description: Raw tag value - default: latest - version: - description: >- - Value for the org.opencontainers.image.version label and annotation. Defaults to the version - metadata-action derives from the ref; pass the same value as to create-manifest when that one - uses raw-tags or flavor. - required: false - -outputs: - image: - description: Reference of the image loaded into the local Docker daemon. Empty unless load is enabled. - value: ${{ steps.prepare.outputs.image }} - imageid: - description: ID of the built image - value: ${{ steps.build.outputs.imageid }} - digest: - description: Digest of the built image - value: ${{ steps.build.outputs.digest }} - -runs: - using: composite - steps: - - - name: Raw tag - id: raw_tag - uses: ASzc/change-string-case-action@v8 - with: - string: ${{ inputs.raw-tag }} - - - name: Prepare ${{ inputs.target }} - shell: bash - id: prepare - env: - PUSH: ${{ inputs.push }} - LOAD: ${{ inputs.load }} - DEFAULT_PUSH: ${{ github.actor != 'dependabot[bot]' }} - LOCAL_TAG: ${{ steps.raw_tag.outputs.lowercase }} - run: | - platform=${{ inputs.platform }} - echo "safe_platform=${platform//\//-}" >> $GITHUB_OUTPUT - - image_name=${{ inputs.image-name }} - echo "safe_image_name=${image_name//\//-}" >> $GITHUB_OUTPUT - - target="${{ inputs.target }}" - echo "safe_target=${target:-_NO_TARGET_}" >> $GITHUB_OUTPUT - - push="$PUSH" - if [ -z "$push" ]; then - if [ "$LOAD" = "true" ]; then - push=false - else - push="$DEFAULT_PUSH" - fi - fi - - if [ "$LOAD" = "true" ] && [ "$push" = "true" ]; then - echo "::error::push and load cannot both be enabled: a build either pushes by digest or loads into the local daemon." - exit 1 - fi - - echo "push=$push" >> $GITHUB_OUTPUT - - if [ "$LOAD" = "true" ]; then - echo "image=${image_name}:${LOCAL_TAG}" >> $GITHUB_OUTPUT - fi - - - name: Docker meta ${{ inputs.target }} - id: meta - uses: docker/metadata-action@v6 - with: - images: ${{ inputs.image-name }} - tags: | - type=schedule - type=ref,event=branch - type=ref,event=tag - type=ref,event=pr - type=raw,value=${{ steps.raw_tag.outputs.lowercase }},enable=${{ github.event_name == 'workflow_dispatch' }} - labels: | - ${{ inputs.version != '' && format('org.opencontainers.image.version={0}', inputs.version) || '' }} - ${{ inputs.title != '' && format('org.opencontainers.image.title={0}', inputs.title) || '' }} - ${{ inputs.description != '' && format('org.opencontainers.image.description={0}', inputs.description) || '' }} - annotations: | - ${{ inputs.version != '' && format('org.opencontainers.image.version={0}', inputs.version) || '' }} - ${{ inputs.title != '' && format('org.opencontainers.image.title={0}', inputs.title) || '' }} - ${{ inputs.description != '' && format('org.opencontainers.image.description={0}', inputs.description) || '' }} - - - name: Drop empty metadata ${{ inputs.target }} - id: metadata - shell: bash - run: | - delimiter="EOF_$(openssl rand -hex 16)" - { - echo "labels<<$delimiter" - jq -r '.labels | to_entries[] | select(.value != "") | .key + "=" + .value' <<< "$DOCKER_METADATA_OUTPUT_JSON" - echo "$delimiter" - echo "annotations<<$delimiter" - jq -r '.annotations[] | select(endswith("=") | not)' <<< "$DOCKER_METADATA_OUTPUT_JSON" - echo "$delimiter" - } >> "$GITHUB_OUTPUT" - - - name: Build and push by digest ${{ inputs.target }} - id: build - uses: docker/build-push-action@v7 - with: - push: ${{ steps.prepare.outputs.push }} - load: ${{ inputs.load }} - tags: ${{ steps.prepare.outputs.image }} - context: ${{ inputs.context }} - file: ${{ inputs.dockerfile}} - platforms: ${{ inputs.platform }} - target: ${{ inputs.target }} - build-args: ${{ inputs.build-args }} - labels: ${{ steps.metadata.outputs.labels }} - annotations: ${{ steps.metadata.outputs.annotations }} - provenance: false - outputs: ${{ inputs.load != 'true' && format('type=image,name={0},push-by-digest=true,name-canonical=true,oci-mediatypes=true', inputs.image-name) || '' }} - cache-from: type=gha,scope=${{ inputs.dockerfile }}-${{ steps.prepare.outputs.safe_platform }}-${{ steps.prepare.outputs.safe_target }} - cache-to: type=gha,mode=max,scope=${{ inputs.dockerfile }}-${{ steps.prepare.outputs.safe_platform }}-${{ steps.prepare.outputs.safe_target }} - secrets: ${{ inputs.secrets }} - - - name: Export digest ${{ inputs.target }} - if: ${{ inputs.load != 'true' }} - shell: bash - run: | - mkdir -p ${{ runner.temp }}/digests/${{ steps.prepare.outputs.safe_image_name }}/${{ steps.prepare.outputs.safe_target }} - digest="${{ steps.build.outputs.digest }}" - touch "${{ runner.temp }}/digests/${{ steps.prepare.outputs.safe_image_name }}/${{ steps.prepare.outputs.safe_target }}/${digest#sha256:}" - - - name: Upload digest ${{ inputs.target }} - if: ${{ inputs.load != 'true' }} - uses: actions/upload-artifact@v7 - with: - name: digests-${{ steps.prepare.outputs.safe_image_name }}-${{ steps.prepare.outputs.safe_target }}-${{ steps.prepare.outputs.safe_platform }} - path: ${{ runner.temp }}/digests/${{ steps.prepare.outputs.safe_image_name }}/${{ steps.prepare.outputs.safe_target }}/* - if-no-files-found: error - retention-days: 1 diff --git a/create-manifest/action.yml b/create-manifest/action.yml deleted file mode 100644 index d3244be..0000000 --- a/create-manifest/action.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: Create Manifest -description: Creates and pushes a multi-platform Docker manifest - -inputs: - image-name: - description: Name of the image - required: true - target: - description: Name of the dockerfile target - required: false - raw-tag: - description: Raw tag value - default: latest - title: - description: Custom image title (overrides repository name) - required: false - description: - description: Custom image description (overrides repository description) - required: false - raw-tags: - description: Additional metadata-action tag directives (multiline), appended to the tags block - required: false - flavor: - description: >- - metadata-action flavor directives (multiline), i.e. "latest=false" to keep a prerelease tag - from moving :latest, or "suffix=-alpine" to publish a variant under the same image name - required: false - version: - description: Value for org.opencontainers.image.version label and annotation - required: false - -runs: - using: composite - steps: - - - name: Prepare - id: prepare - shell: bash - env: - IMAGE_NAME: ${{ inputs.image-name }} - run: | - primary_image_name=$(printf '%s\n' "$IMAGE_NAME" | sed '/^[[:space:]]*$/d' | head -n1 | xargs) - echo "primary_image_name=$primary_image_name" >> $GITHUB_OUTPUT - echo "safe_image_name=${primary_image_name//\//-}" >> $GITHUB_OUTPUT - - target="${{ inputs.target }}" - echo "safe_target=${target:-_NO_TARGET_}" >> $GITHUB_OUTPUT - - - name: Download digests ${{ inputs.target }} - uses: actions/download-artifact@v8 - with: - path: ${{ runner.temp }}/digests/${{ steps.prepare.outputs.safe_image_name }}/${{ steps.prepare.outputs.safe_target }} - pattern: digests-${{ steps.prepare.outputs.safe_image_name }}-${{ steps.prepare.outputs.safe_target }}-* - merge-multiple: true - - - name: Raw tag - id: raw_tag - uses: ASzc/change-string-case-action@v8 - with: - string: ${{ inputs.raw-tag }} - - - name: Docker meta ${{ inputs.target }} - id: meta - uses: docker/metadata-action@v6 - with: - images: ${{ inputs.image-name }} - tags: | - type=schedule - type=ref,event=branch - type=ref,event=tag - type=ref,event=pr - type=raw,value=${{ steps.raw_tag.outputs.lowercase }},enable=${{ github.event_name == 'workflow_dispatch' }} - ${{ inputs.raw-tags }} - flavor: ${{ inputs.flavor }} - labels: | - ${{ inputs.version != '' && format('org.opencontainers.image.version={0}', inputs.version) || '' }} - ${{ inputs.title != '' && format('org.opencontainers.image.title={0}', inputs.title) || '' }} - ${{ inputs.description != '' && format('org.opencontainers.image.description={0}', inputs.description) || '' }} - annotations: | - ${{ inputs.version != '' && format('org.opencontainers.image.version={0}', inputs.version) || '' }} - ${{ inputs.title != '' && format('org.opencontainers.image.title={0}', inputs.title) || '' }} - ${{ inputs.description != '' && format('org.opencontainers.image.description={0}', inputs.description) || '' }} - - - name: Create manifest list and push - working-directory: ${{ runner.temp }}/digests/${{ steps.prepare.outputs.safe_image_name }}/${{ steps.prepare.outputs.safe_target }} - shell: bash - run: | - mapfile -t tags < <(jq -r '.tags[] | "-t\n" + .' <<< "$DOCKER_METADATA_OUTPUT_JSON") - mapfile -t annotations < <(jq -r ' - .labels | to_entries[] | select(.value != "") | - "--annotation\nindex:" + .key + "=" + .value + "\n--annotation\nmanifest-descriptor:" + .key + "=" + .value - ' <<< "$DOCKER_METADATA_OUTPUT_JSON") - images=$(printf '${{ steps.prepare.outputs.primary_image_name }}@sha256:%s ' *) - - docker buildx imagetools create "${tags[@]}" "${annotations[@]}" $images - - - name: Inspect image - shell: bash - run: | - docker buildx imagetools inspect ${{ steps.prepare.outputs.primary_image_name }}:${{ steps.meta.outputs.version }}