From 108d8020c88a8121682dbbdaeab0d03e21b0a9ac Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Tue, 15 Oct 2024 16:33:14 +0100 Subject: [PATCH] Add ability to tag latest images during publishing (#427) --- .github/workflows/tox.yml | 2 ++ tools/ee.sh | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 3450f60..7ecfa6f 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -64,7 +64,9 @@ jobs: if: github.event_name == 'release' && github.event.action == 'published' run: | docker tag "ghcr.io/ansible/ansible-devspaces:${GITHUB_SHA}" "ghcr.io/ansible/ansible-devspaces:${{ github.event.release.tag_name }}" + docker tag "ghcr.io/ansible/ansible-devspaces:${GITHUB_SHA}" "ghcr.io/ansible/ansible-devspaces:latest" docker push "ghcr.io/ansible/ansible-devspaces:${{ github.event.release.tag_name }}" + docker push "ghcr.io/ansible/ansible-devspaces:latest" publish-wheel: needs: diff --git a/tools/ee.sh b/tools/ee.sh index 3ec2a11..4283ab6 100755 --- a/tools/ee.sh +++ b/tools/ee.sh @@ -42,14 +42,15 @@ if [ "--publish" == "${1:-}" ]; then ${ADT_CONTAINER_ENGINE} pull -q "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64" ${ADT_CONTAINER_ENGINE} pull -q "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-amd64" - TAG=ghcr.io/ansible/community-ansible-dev-tools:${2:-} - ${ADT_CONTAINER_ENGINE} manifest create "$TAG" --amend "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-amd64" --amend "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64" - ${ADT_CONTAINER_ENGINE} manifest annotate --arch arm64 "$TAG" "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64" + for TAG in ghcr.io/ansible/community-ansible-dev-tools:${2:-} ghcr.io/ansible/community-ansible-dev-tools:latest; do + ${ADT_CONTAINER_ENGINE} manifest create "$TAG" --amend "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-amd64" --amend "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64" + ${ADT_CONTAINER_ENGINE} manifest annotate --arch arm64 "$TAG" "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64" - # We push only when there is a release, and that is when $2 is not the same as GITHUB_SHA - if [ "--dry" != "${3:-}" ]; then - ${ADT_CONTAINER_ENGINE} manifest push "$TAG" - fi + # We push only when there is a release, and that is when $2 is not the same as GITHUB_SHA + if [ "--dry" != "${3:-}" ]; then + ${ADT_CONTAINER_ENGINE} manifest push "$TAG" + fi + done exit 0 fi