From c80a4fc514bcc2fc0f437abb9c288126864f1e49 Mon Sep 17 00:00:00 2001 From: Yohann Paris Date: Mon, 22 Apr 2024 11:57:38 -0400 Subject: [PATCH] let's try --- .github/workflows/image-tag.yml | 20 ++++++++++++++------ .github/workflows/merge-images.yml | 20 ++++++++------------ .github/workflows/publish-client.yml | 14 +++++++------- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.github/workflows/image-tag.yml b/.github/workflows/image-tag.yml index 411f564424..92d3fa905a 100644 --- a/.github/workflows/image-tag.yml +++ b/.github/workflows/image-tag.yml @@ -3,15 +3,21 @@ name: image-tag.yml on: workflow_call: + inputs: + image-name: + required: true + description: 'The name of the image to be built' + type: string outputs: - tag: - description: 'The tag of the image to be built' - value: ${{ jobs.image-tag.outputs.tag }} + tagged-image-name: + description: 'The tagged name of the image to be built' + value: ${{ jobs.image-tag.outputs.name }} jobs: image-tag: + name: Define image tag runs-on: ubuntu-22.04 outputs: - tag: ${{ steps.define.outputs.tag }} + name: ${{ steps.define.outputs.name }} steps: - id: define run: | @@ -25,5 +31,7 @@ jobs: TAG=${{ github.ref_name }} fi fi - echo "${TAG,,}" - echo "tag=${TAG,,}" >> $GITHUB_OUTPUT + + IMAGE=${{ inputs.image-name }}:${TAG,,} + echo "$IMAGE" + echo "name=$IMAGE" >> $GITHUB_OUTPUT diff --git a/.github/workflows/merge-images.yml b/.github/workflows/merge-images.yml index ccd341792c..1759839359 100644 --- a/.github/workflows/merge-images.yml +++ b/.github/workflows/merge-images.yml @@ -5,14 +5,10 @@ name: merge-images.yml on: workflow_call: inputs: - image_name: + name: required: true description: 'The name of the image to be merged' type: string - image_tag: - required: true - description: 'The tag of the image to be merged' - type: string jobs: merge-images: @@ -27,10 +23,10 @@ jobs: - name: Create, inspect and publish manifest run: | - docker manifest create ${{ inputs.image_name }}:${{ inputs.image_tag }} \ - --amend ${{ inputs.image_name }}:${{ inputs.image_tag }}--amd64 \ - --amend ${{ inputs.image_name }}:${{ inputs.image_tag }}--arm64 - docker manifest annotate --arch amd64 --os linux ${{ inputs.image_name }}:${{ inputs.image_tag }} ${{ inputs.image_name }}:${{ inputs.image_tag }}--amd64 - docker manifest annotate --arch arm64 --os linux ${{ inputs.image_name }}:${{ inputs.image_tag }} ${{ inputs.image_name }}:${{ inputs.image_tag }}}--arm64 - docker manifest inspect ${{ inputs.image_name }}:${{ inputs.image_tag }} - docker manifest push ${{ inputs.image_name }}:${{ inputs.image_tag }} + docker manifest create ${{ inputs.name }} \ + --amend ${{ inputs.name }}--amd64 \ + --amend ${{ inputs.name }}--arm64 + docker manifest annotate --arch amd64 --os linux ${{ inputs.name }} ${{ inputs.name }}--amd64 + docker manifest annotate --arch arm64 --os linux ${{ inputs.name }} ${{ inputs.name }}--arm64 + docker manifest inspect ${{ inputs.name }} + docker manifest push ${{ inputs.name }} diff --git a/.github/workflows/publish-client.yml b/.github/workflows/publish-client.yml index 27a6d46acb..cdd9cfc069 100644 --- a/.github/workflows/publish-client.yml +++ b/.github/workflows/publish-client.yml @@ -13,8 +13,10 @@ on: jobs: image-tag: - name: Create image tag + name: Get tagged image name uses: ./.github/workflows/image-tag.yml + with: + image-name: ghcr.io/darpa-askem/hmi-client amd64: if: false @@ -122,14 +124,12 @@ jobs: tags: ghcr.io/darpa-askem/hmi-client:${{ needs.image-tag.outputs.tag }}--arm64 merge-images: - name: Merge into one manifest + name: Merge AMD64 and ARM64 images under one manifest needs: - image-tag - # - amd64 + - amd64 # - arm64-macos - # - arm64-emulation + - arm64-emulation uses: ./.github/workflows/merge-images.yml with: - image_name: ghcr.io/darpa-askem/hmi-client - image_tag: ${{ needs.image-tag.outputs.tag }} - #secrets: inherit + name: ${{ needs.image-tag.outputs.tagged-image-name }}