From 9e50373a95cf7baed18dafb777e4dc0b248cd2d6 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Mon, 19 Jul 2021 17:16:21 +0900 Subject: [PATCH 01/20] feat: publish arm image in release Signed-off-by: Ayato Tachibana --- .github/workflows/release.yaml | 27 ++++++++++++++++++++++++++- Dockerfile | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f6418a1743762..29b2f0c63b3dd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -84,6 +84,7 @@ jobs: echo "TARGET_BRANCH=${TARGET_BRANCH}" >> $GITHUB_ENV echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV echo "PRE_RELEASE=${PRE_RELEASE}" >> $GITHUB_ENV + echo "IMAGE_FULLNAME_ARM64=${IMAGE_NAMESPACE}/argocd:v${TARGET_VERSION}-arm64" >> $GITHUB_ENV - name: Check if our release tag has a correct annotation run: | @@ -145,6 +146,15 @@ jobs: with: go-version: ${{ env.GOLANG_VERSION }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: arm64 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + - name: Setup Git author information run: | set -ue @@ -182,7 +192,7 @@ jobs: echo "Creating release ${RELEASE_TAG}" git tag ${RELEASE_TAG} - - name: Build Docker image for release + - name: Build amd64 Docker image for release run: | set -ue git clean -fd @@ -193,6 +203,18 @@ jobs: ./dist/argocd-linux-amd64 version --client if: ${{ env.DRY_RUN != 'true' }} + - name: Build arm64 Docker image for release + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfile + platforms: linux/arm64 + tags: ${{ env.IMAGE_FULLNAME_ARM64 }} + build-args: | + BUILD_ALL_CLIS=false + load: true + if: ${{ env.DRY_RUN != 'true' }} + - name: Push docker image to repository env: DOCKER_USERNAME: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }} @@ -203,10 +225,13 @@ jobs: set -ue docker login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_TOKEN}" docker push ${IMAGE_NAMESPACE}/argocd:v${TARGET_VERSION} + docker push ${IMAGE_FULLNAME_ARM64} # Remove the following when Docker Hub is gone docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" docker tag ${IMAGE_NAMESPACE}/argocd:v${TARGET_VERSION} argoproj/argocd:v${TARGET_VERSION} + docker tag ${IMAGE_FULLNAME_ARM64} argoproj/argocd:v${TARGET_VERSION}-arm64 docker push argoproj/argocd:v${TARGET_VERSION} + docker push argoproj/argocd:v${TARGET_VERSION}-arm64 if: ${{ env.DRY_RUN != 'true' }} - name: Read release notes file diff --git a/Dockerfile b/Dockerfile index c395825692149..4a03ed42e6cda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -91,7 +91,7 @@ FROM docker.io/library/node:12.18.4 as argocd-ui WORKDIR /src ADD ["ui/package.json", "ui/yarn.lock", "./"] -RUN yarn install +RUN yarn install --network-timeout 100000 ADD ["ui/", "."] From a08008a3752a7701306da610191382bb0386a1ed Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 13:32:09 +0900 Subject: [PATCH 02/20] fix arm64 release workflow to be separated Signed-off-by: Ayato Tachibana --- .github/workflows/release-arm64.yaml | 141 +++++++++++++++++++++++++++ .github/workflows/release.yaml | 27 +---- 2 files changed, 142 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/release-arm64.yaml diff --git a/.github/workflows/release-arm64.yaml b/.github/workflows/release-arm64.yaml new file mode 100644 index 0000000000000..344d56ef66b33 --- /dev/null +++ b/.github/workflows/release-arm64.yaml @@ -0,0 +1,141 @@ +name: Create ArgoCD arm64 release +on: + workflow_run: + workflows: ["Create ArgoCD release"] + types: + - completed + +env: + GOLANG_VERSION: '1.16.5' + +jobs: + prepare-release: + name: Perform automatic arm64 release on trigger ${{ github.ref }} + runs-on: ubuntu-latest + env: + # The name of the tag as supplied by the GitHub event + SOURCE_TAG: ${{ github.ref }} + # The image namespace where Docker image will be published to + IMAGE_NAMESPACE: quay.io/argoproj + # Whether to create & push image and release assets + DRY_RUN: false + # Whether a draft release should be created, instead of public one + DRAFT_RELEASE: false + # Whether to update homebrew with this release as well + # Set RELEASE_HOMEBREW_TOKEN secret in repository for this to work - needs + # access to public repositories + UPDATE_HOMEBREW: false + # Name of the GitHub user for Git config + GIT_USERNAME: argo-bot + # E-Mail of the GitHub user for Git config + GIT_EMAIL: argoproj@gmail.com + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Check if the published tag is well formed and setup vars + run: | + set -xue + # Target version must match major.minor.patch and optional -rcX suffix + # where X must be a number. + TARGET_VERSION=${SOURCE_TAG#*release-v} + if ! echo "${TARGET_VERSION}" | egrep '^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)*$'; then + echo "::error::Target version '${TARGET_VERSION}' is malformed, refusing to continue." >&2 + exit 1 + fi + + # Target branch is the release branch we're going to operate on + # Its name is 'release-.' + TARGET_BRANCH="release-${TARGET_VERSION%\.[0-9]*}" + + # The release tag is the source tag, minus the release- prefix + RELEASE_TAG="${SOURCE_TAG#*release-}" + + # Whether this is a pre-release (indicated by -rc suffix) + PRE_RELEASE=false + if echo "${RELEASE_TAG}" | egrep -- '-rc[0-9]+$'; then + PRE_RELEASE=true + fi + + # We must not have a release trigger within the same release branch, + # because that means a release for this branch is already running. + if git tag -l | grep "release-v${TARGET_VERSION%\.[0-9]*}" | grep -v "release-v${TARGET_VERSION}"; then + echo "::error::Another release for branch ${TARGET_BRANCH} is currently in progress." + exit 1 + fi + + # Ensure that release do not yet exist + if git rev-parse ${RELEASE_TAG}; then + echo "::error::Release tag ${RELEASE_TAG} already exists in repository. Refusing to continue." + exit 1 + fi + + # Make the variables available in follow-up steps + echo "TARGET_VERSION=${TARGET_VERSION}" >> $GITHUB_ENV + echo "TARGET_BRANCH=${TARGET_BRANCH}" >> $GITHUB_ENV + echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV + echo "PRE_RELEASE=${PRE_RELEASE}" >> $GITHUB_ENV + + - name: Setup Golang + uses: actions/setup-go@v1 + with: + go-version: ${{ env.GOLANG_VERSION }} + + - name: Checkout corresponding release branch + run: | + set -ue + echo "Switching to release branch '${TARGET_BRANCH}'" + if ! git checkout ${TARGET_BRANCH}; then + echo "::error::Checking out release branch '${TARGET_BRANCH}' for target version '${TARGET_VERSION}' (tagged '${RELEASE_TAG}') failed. Does it exist in repo?" + exit 1 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: arm64 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Build arm64 Docker image for release + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfile + platforms: linux/arm64 + tags: | + ${{ env.IMAGE_NAMESPACE }}/argocd:${{ env.RELEASE_TAG }}-arm64 + argoproj/argocd:${{ env.RELEASE_TAG }}-arm64 + build-args: | + BUILD_ALL_CLIS=false + load: true + if: ${{ env.DRY_RUN != 'true' }} + + - name: Push docker image to repository + env: + DOCKER_USERNAME: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }} + DOCKER_TOKEN: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }} + QUAY_USERNAME: ${{ secrets.RELEASE_QUAY_USERNAME }} + QUAY_TOKEN: ${{ secrets.RELEASE_QUAY_TOKEN }} + run: | + set -ue + docker login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_TOKEN}" + docker push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 + # Create docker multi-arch manifest + docker manifest create ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch \ + --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG} \ + --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 + docker push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch + # Remove the following when Docker Hub is gone + docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" + docker push argoproj/argocd:${RELEASE_TAG}-amd64 + docker push argoproj/argocd:${RELEASE_TAG}-arm64 + docker manifest create argoproj/argocd:${RELEASE_TAG}-multiarch \ + --amend argoproj/argocd:${RELEASE_TAG} \ + --amend argoproj/argocd:${RELEASE_TAG}-arm64 + docker push argoproj/argocd:${RELEASE_TAG}-multiarch + if: ${{ env.DRY_RUN != 'true' }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 29b2f0c63b3dd..f6418a1743762 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -84,7 +84,6 @@ jobs: echo "TARGET_BRANCH=${TARGET_BRANCH}" >> $GITHUB_ENV echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV echo "PRE_RELEASE=${PRE_RELEASE}" >> $GITHUB_ENV - echo "IMAGE_FULLNAME_ARM64=${IMAGE_NAMESPACE}/argocd:v${TARGET_VERSION}-arm64" >> $GITHUB_ENV - name: Check if our release tag has a correct annotation run: | @@ -146,15 +145,6 @@ jobs: with: go-version: ${{ env.GOLANG_VERSION }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - with: - platforms: arm64 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - name: Setup Git author information run: | set -ue @@ -192,7 +182,7 @@ jobs: echo "Creating release ${RELEASE_TAG}" git tag ${RELEASE_TAG} - - name: Build amd64 Docker image for release + - name: Build Docker image for release run: | set -ue git clean -fd @@ -203,18 +193,6 @@ jobs: ./dist/argocd-linux-amd64 version --client if: ${{ env.DRY_RUN != 'true' }} - - name: Build arm64 Docker image for release - uses: docker/build-push-action@v2 - with: - context: . - file: Dockerfile - platforms: linux/arm64 - tags: ${{ env.IMAGE_FULLNAME_ARM64 }} - build-args: | - BUILD_ALL_CLIS=false - load: true - if: ${{ env.DRY_RUN != 'true' }} - - name: Push docker image to repository env: DOCKER_USERNAME: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }} @@ -225,13 +203,10 @@ jobs: set -ue docker login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_TOKEN}" docker push ${IMAGE_NAMESPACE}/argocd:v${TARGET_VERSION} - docker push ${IMAGE_FULLNAME_ARM64} # Remove the following when Docker Hub is gone docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" docker tag ${IMAGE_NAMESPACE}/argocd:v${TARGET_VERSION} argoproj/argocd:v${TARGET_VERSION} - docker tag ${IMAGE_FULLNAME_ARM64} argoproj/argocd:v${TARGET_VERSION}-arm64 docker push argoproj/argocd:v${TARGET_VERSION} - docker push argoproj/argocd:v${TARGET_VERSION}-arm64 if: ${{ env.DRY_RUN != 'true' }} - name: Read release notes file From 38ca08de65edf77b49894cebee7a3dd5409ab160 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 14:10:53 +0900 Subject: [PATCH 03/20] add workflow_dispatch Signed-off-by: Ayato Tachibana --- .../{release-arm64.yaml => push-multiarch-image.yaml} | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) rename .github/workflows/{release-arm64.yaml => push-multiarch-image.yaml} (94%) diff --git a/.github/workflows/release-arm64.yaml b/.github/workflows/push-multiarch-image.yaml similarity index 94% rename from .github/workflows/release-arm64.yaml rename to .github/workflows/push-multiarch-image.yaml index 344d56ef66b33..7ccc6c7f37e2e 100644 --- a/.github/workflows/release-arm64.yaml +++ b/.github/workflows/push-multiarch-image.yaml @@ -1,20 +1,24 @@ -name: Create ArgoCD arm64 release +name: Push ArgoCD multiarch image on: workflow_run: workflows: ["Create ArgoCD release"] types: - completed + workflow_dispatch: + release-tag-name: + description: 'The release tag name that triggers this workflow (i.e. release-v2.0.0)' + required: true env: GOLANG_VERSION: '1.16.5' jobs: prepare-release: - name: Perform automatic arm64 release on trigger ${{ github.ref }} + name: Perform automatic arm64 release on trigger ${{ github.event.inputs.release-tag-name || github.ref }} runs-on: ubuntu-latest env: # The name of the tag as supplied by the GitHub event - SOURCE_TAG: ${{ github.ref }} + SOURCE_TAG: ${{ github.event.inputs.release-tag-name || github.ref }} # The image namespace where Docker image will be published to IMAGE_NAMESPACE: quay.io/argoproj # Whether to create & push image and release assets From 7d086673a381b51f612fed9dde34a24d08b2b128 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 15:13:52 +0900 Subject: [PATCH 04/20] run multiarch workflow when release conclusion is success Signed-off-by: Ayato Tachibana --- .github/workflows/push-multiarch-image.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push-multiarch-image.yaml b/.github/workflows/push-multiarch-image.yaml index 7ccc6c7f37e2e..69f6981699087 100644 --- a/.github/workflows/push-multiarch-image.yaml +++ b/.github/workflows/push-multiarch-image.yaml @@ -16,6 +16,7 @@ jobs: prepare-release: name: Perform automatic arm64 release on trigger ${{ github.event.inputs.release-tag-name || github.ref }} runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} env: # The name of the tag as supplied by the GitHub event SOURCE_TAG: ${{ github.event.inputs.release-tag-name || github.ref }} From 29577be3d088777e7b9a0eead87c9ce9f1505924 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 15:16:33 +0900 Subject: [PATCH 05/20] fix syntax Signed-off-by: Ayato Tachibana --- .github/workflows/push-multiarch-image.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push-multiarch-image.yaml b/.github/workflows/push-multiarch-image.yaml index 69f6981699087..4e7a33dbd713c 100644 --- a/.github/workflows/push-multiarch-image.yaml +++ b/.github/workflows/push-multiarch-image.yaml @@ -5,9 +5,10 @@ on: types: - completed workflow_dispatch: - release-tag-name: - description: 'The release tag name that triggers this workflow (i.e. release-v2.0.0)' - required: true + input: + release-tag-name: + description: 'The release tag name that triggers this workflow (i.e. release-v2.0.0)' + required: true env: GOLANG_VERSION: '1.16.5' From 19fe35066b99c6186106a87c4cc70522fb2477f5 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 15:18:07 +0900 Subject: [PATCH 06/20] fix syntax Signed-off-by: Ayato Tachibana --- .github/workflows/push-multiarch-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-multiarch-image.yaml b/.github/workflows/push-multiarch-image.yaml index 4e7a33dbd713c..d79ea09b8ef57 100644 --- a/.github/workflows/push-multiarch-image.yaml +++ b/.github/workflows/push-multiarch-image.yaml @@ -5,7 +5,7 @@ on: types: - completed workflow_dispatch: - input: + inputs: release-tag-name: description: 'The release tag name that triggers this workflow (i.e. release-v2.0.0)' required: true From e0674eab9bc4e9eeb202be3bd778ea16c066fcd2 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 15:34:32 +0900 Subject: [PATCH 07/20] fix multiarch tag validation Signed-off-by: Ayato Tachibana --- .github/workflows/push-multiarch-image.yaml | 29 --------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/push-multiarch-image.yaml b/.github/workflows/push-multiarch-image.yaml index d79ea09b8ef57..fa9987e2a15a2 100644 --- a/.github/workflows/push-multiarch-image.yaml +++ b/.github/workflows/push-multiarch-image.yaml @@ -27,14 +27,6 @@ jobs: DRY_RUN: false # Whether a draft release should be created, instead of public one DRAFT_RELEASE: false - # Whether to update homebrew with this release as well - # Set RELEASE_HOMEBREW_TOKEN secret in repository for this to work - needs - # access to public repositories - UPDATE_HOMEBREW: false - # Name of the GitHub user for Git config - GIT_USERNAME: argo-bot - # E-Mail of the GitHub user for Git config - GIT_EMAIL: argoproj@gmail.com steps: - name: Checkout code uses: actions/checkout@v2 @@ -60,30 +52,10 @@ jobs: # The release tag is the source tag, minus the release- prefix RELEASE_TAG="${SOURCE_TAG#*release-}" - # Whether this is a pre-release (indicated by -rc suffix) - PRE_RELEASE=false - if echo "${RELEASE_TAG}" | egrep -- '-rc[0-9]+$'; then - PRE_RELEASE=true - fi - - # We must not have a release trigger within the same release branch, - # because that means a release for this branch is already running. - if git tag -l | grep "release-v${TARGET_VERSION%\.[0-9]*}" | grep -v "release-v${TARGET_VERSION}"; then - echo "::error::Another release for branch ${TARGET_BRANCH} is currently in progress." - exit 1 - fi - - # Ensure that release do not yet exist - if git rev-parse ${RELEASE_TAG}; then - echo "::error::Release tag ${RELEASE_TAG} already exists in repository. Refusing to continue." - exit 1 - fi - # Make the variables available in follow-up steps echo "TARGET_VERSION=${TARGET_VERSION}" >> $GITHUB_ENV echo "TARGET_BRANCH=${TARGET_BRANCH}" >> $GITHUB_ENV echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV - echo "PRE_RELEASE=${PRE_RELEASE}" >> $GITHUB_ENV - name: Setup Golang uses: actions/setup-go@v1 @@ -138,7 +110,6 @@ jobs: docker push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch # Remove the following when Docker Hub is gone docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" - docker push argoproj/argocd:${RELEASE_TAG}-amd64 docker push argoproj/argocd:${RELEASE_TAG}-arm64 docker manifest create argoproj/argocd:${RELEASE_TAG}-multiarch \ --amend argoproj/argocd:${RELEASE_TAG} \ From c55de51acaed059c628f64a8ea6718ccc9ff46fa Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 15:42:38 +0900 Subject: [PATCH 08/20] fix syntax Signed-off-by: Ayato Tachibana --- .github/workflows/push-multiarch-image.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push-multiarch-image.yaml b/.github/workflows/push-multiarch-image.yaml index fa9987e2a15a2..1b24f7eb83147 100644 --- a/.github/workflows/push-multiarch-image.yaml +++ b/.github/workflows/push-multiarch-image.yaml @@ -69,6 +69,7 @@ jobs: if ! git checkout ${TARGET_BRANCH}; then echo "::error::Checking out release branch '${TARGET_BRANCH}' for target version '${TARGET_VERSION}' (tagged '${RELEASE_TAG}') failed. Does it exist in repo?" exit 1 + fi - name: Set up QEMU uses: docker/setup-qemu-action@v1 From 6fd2e27fd133641beb48c5489d11f5f5c6611e29 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 16:01:37 +0900 Subject: [PATCH 09/20] fix multiarch workflow to be compatible with workflow_dispatch Signed-off-by: Ayato Tachibana --- .github/workflows/push-multiarch-image.yaml | 22 +++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push-multiarch-image.yaml b/.github/workflows/push-multiarch-image.yaml index 1b24f7eb83147..9a5616e834e25 100644 --- a/.github/workflows/push-multiarch-image.yaml +++ b/.github/workflows/push-multiarch-image.yaml @@ -25,8 +25,6 @@ jobs: IMAGE_NAMESPACE: quay.io/argoproj # Whether to create & push image and release assets DRY_RUN: false - # Whether a draft release should be created, instead of public one - DRAFT_RELEASE: false steps: - name: Checkout code uses: actions/checkout@v2 @@ -94,7 +92,7 @@ jobs: load: true if: ${{ env.DRY_RUN != 'true' }} - - name: Push docker image to repository + - name: Push docker image and multiarch manifest to repository env: DOCKER_USERNAME: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }} DOCKER_TOKEN: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }} @@ -116,4 +114,20 @@ jobs: --amend argoproj/argocd:${RELEASE_TAG} \ --amend argoproj/argocd:${RELEASE_TAG}-arm64 docker push argoproj/argocd:${RELEASE_TAG}-multiarch - if: ${{ env.DRY_RUN != 'true' }} + if: ${{ env.DRY_RUN != 'true' && github.event_name == 'workflow_run' }} + + - name: Push docker image to repository + env: + DOCKER_USERNAME: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }} + DOCKER_TOKEN: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }} + QUAY_USERNAME: ${{ secrets.RELEASE_QUAY_USERNAME }} + QUAY_TOKEN: ${{ secrets.RELEASE_QUAY_TOKEN }} + run: | + set -ue + docker login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_TOKEN}" + docker push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 + # Remove the following when Docker Hub is gone + docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" + docker push argoproj/argocd:${RELEASE_TAG}-arm64 + if: ${{ env.DRY_RUN != 'true' && github.event_name == 'workflow_dispatch' }} + From 039c5b236c244c9e6bbe380134dd8b0f95a073bb Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 16:38:02 +0900 Subject: [PATCH 10/20] fix multiarch workflow Signed-off-by: Ayato Tachibana --- .github/workflows/push-multiarch-image.yaml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/push-multiarch-image.yaml b/.github/workflows/push-multiarch-image.yaml index 9a5616e834e25..e290b1f2e70d5 100644 --- a/.github/workflows/push-multiarch-image.yaml +++ b/.github/workflows/push-multiarch-image.yaml @@ -1,4 +1,5 @@ name: Push ArgoCD multiarch image + on: workflow_run: workflows: ["Create ArgoCD release"] @@ -7,12 +8,9 @@ on: workflow_dispatch: inputs: release-tag-name: - description: 'The release tag name that triggers this workflow (i.e. release-v2.0.0)' + description: 'The release tag name that triggers this workflow (e.g. release-v2.0.0)' required: true -env: - GOLANG_VERSION: '1.16.5' - jobs: prepare-release: name: Perform automatic arm64 release on trigger ${{ github.event.inputs.release-tag-name || github.ref }} @@ -55,11 +53,6 @@ jobs: echo "TARGET_BRANCH=${TARGET_BRANCH}" >> $GITHUB_ENV echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV - - name: Setup Golang - uses: actions/setup-go@v1 - with: - go-version: ${{ env.GOLANG_VERSION }} - - name: Checkout corresponding release branch run: | set -ue From fa0603aac425b6f33c64588f70308b7754c49faf Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 21:48:41 +0900 Subject: [PATCH 11/20] fix multiarch release to one file Signed-off-by: Ayato Tachibana --- .github/workflows/push-multiarch-image.yaml | 35 +------- .github/workflows/release.yaml | 96 +++++++++++++++++++++ 2 files changed, 99 insertions(+), 32 deletions(-) diff --git a/.github/workflows/push-multiarch-image.yaml b/.github/workflows/push-multiarch-image.yaml index e290b1f2e70d5..5786ec1aa38ad 100644 --- a/.github/workflows/push-multiarch-image.yaml +++ b/.github/workflows/push-multiarch-image.yaml @@ -1,10 +1,6 @@ name: Push ArgoCD multiarch image on: - workflow_run: - workflows: ["Create ArgoCD release"] - types: - - completed workflow_dispatch: inputs: release-tag-name: @@ -13,12 +9,11 @@ on: jobs: prepare-release: - name: Perform automatic arm64 release on trigger ${{ github.event.inputs.release-tag-name || github.ref }} + name: Perform automatic multiarch release on trigger ${{ github.event.inputs.release-tag-name }} runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} env: # The name of the tag as supplied by the GitHub event - SOURCE_TAG: ${{ github.event.inputs.release-tag-name || github.ref }} + SOURCE_TAG: ${{ github.event.inputs.release-tag-name }} # The image namespace where Docker image will be published to IMAGE_NAMESPACE: quay.io/argoproj # Whether to create & push image and release assets @@ -85,30 +80,6 @@ jobs: load: true if: ${{ env.DRY_RUN != 'true' }} - - name: Push docker image and multiarch manifest to repository - env: - DOCKER_USERNAME: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }} - DOCKER_TOKEN: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }} - QUAY_USERNAME: ${{ secrets.RELEASE_QUAY_USERNAME }} - QUAY_TOKEN: ${{ secrets.RELEASE_QUAY_TOKEN }} - run: | - set -ue - docker login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_TOKEN}" - docker push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 - # Create docker multi-arch manifest - docker manifest create ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch \ - --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG} \ - --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 - docker push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch - # Remove the following when Docker Hub is gone - docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" - docker push argoproj/argocd:${RELEASE_TAG}-arm64 - docker manifest create argoproj/argocd:${RELEASE_TAG}-multiarch \ - --amend argoproj/argocd:${RELEASE_TAG} \ - --amend argoproj/argocd:${RELEASE_TAG}-arm64 - docker push argoproj/argocd:${RELEASE_TAG}-multiarch - if: ${{ env.DRY_RUN != 'true' && github.event_name == 'workflow_run' }} - - name: Push docker image to repository env: DOCKER_USERNAME: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }} @@ -122,5 +93,5 @@ jobs: # Remove the following when Docker Hub is gone docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" docker push argoproj/argocd:${RELEASE_TAG}-arm64 - if: ${{ env.DRY_RUN != 'true' && github.event_name == 'workflow_dispatch' }} + if: ${{ env.DRY_RUN != 'true' }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f6418a1743762..d80e465060e66 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -309,6 +309,102 @@ jobs: formula: argocd if: ${{ env.HOMEBREW_TOKEN != '' && env.UPDATE_HOMEBREW == 'true' && env.PRE_RELEASE != 'true' }} + push-multiarch-images: + name: Perform automatic multiarch release on trigger ${{ github.ref }} + runs-on: ubuntu-latest + env: + # The name of the tag as supplied by the GitHub event + SOURCE_TAG: ${{ github.ref }} + # The image namespace where Docker image will be published to + IMAGE_NAMESPACE: quay.io/argoproj + # Whether to create & push image and release assets + DRY_RUN: false + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Check if the published tag is well formed and setup vars + run: | + set -xue + # Target version must match major.minor.patch and optional -rcX suffix + # where X must be a number. + TARGET_VERSION=${SOURCE_TAG#*release-v} + if ! echo "${TARGET_VERSION}" | egrep '^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)*$'; then + echo "::error::Target version '${TARGET_VERSION}' is malformed, refusing to continue." >&2 + exit 1 + fi + + # Target branch is the release branch we're going to operate on + # Its name is 'release-.' + TARGET_BRANCH="release-${TARGET_VERSION%\.[0-9]*}" + + # The release tag is the source tag, minus the release- prefix + RELEASE_TAG="${SOURCE_TAG#*release-}" + + # Make the variables available in follow-up steps + echo "TARGET_VERSION=${TARGET_VERSION}" >> $GITHUB_ENV + echo "TARGET_BRANCH=${TARGET_BRANCH}" >> $GITHUB_ENV + echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV + + - name: Checkout corresponding release branch + run: | + set -ue + echo "Switching to release branch '${TARGET_BRANCH}'" + if ! git checkout ${TARGET_BRANCH}; then + echo "::error::Checking out release branch '${TARGET_BRANCH}' for target version '${TARGET_VERSION}' (tagged '${RELEASE_TAG}') failed. Does it exist in repo?" + exit 1 + fi + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: arm64 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Build arm64 Docker image for release + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfile + platforms: linux/arm64 + tags: | + ${{ env.IMAGE_NAMESPACE }}/argocd:${{ env.RELEASE_TAG }}-arm64 + argoproj/argocd:${{ env.RELEASE_TAG }}-arm64 + build-args: | + BUILD_ALL_CLIS=false + load: true + if: ${{ env.DRY_RUN != 'true' }} + + - name: Push docker image and multiarch manifest to repository + env: + DOCKER_USERNAME: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }} + DOCKER_TOKEN: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }} + QUAY_USERNAME: ${{ secrets.RELEASE_QUAY_USERNAME }} + QUAY_TOKEN: ${{ secrets.RELEASE_QUAY_TOKEN }} + run: | + set -ue + docker login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_TOKEN}" + docker push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 + # Create docker multi-arch manifest + docker manifest create ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch \ + --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG} \ + --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 + docker push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch + # Remove the following when Docker Hub is gone + docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" + docker push argoproj/argocd:${RELEASE_TAG}-arm64 + docker manifest create argoproj/argocd:${RELEASE_TAG}-multiarch \ + --amend argoproj/argocd:${RELEASE_TAG} \ + --amend argoproj/argocd:${RELEASE_TAG}-arm64 + docker push argoproj/argocd:${RELEASE_TAG}-multiarch + if: ${{ env.DRY_RUN != 'true' }} + - name: Delete original request tag from repository run: | set -ue From 27364a06ea7fa4dd3dc7d71957fb28c601f3b7c7 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 21:56:37 +0900 Subject: [PATCH 12/20] fix multiarch release to be processed after amd64 release Signed-off-by: Ayato Tachibana --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d80e465060e66..8bd270db1b452 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -312,6 +312,7 @@ jobs: push-multiarch-images: name: Perform automatic multiarch release on trigger ${{ github.ref }} runs-on: ubuntu-latest + needs: prepare-release env: # The name of the tag as supplied by the GitHub event SOURCE_TAG: ${{ github.ref }} From bcf4727c32c7128973dfc67df18217de40a99870 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 12 Aug 2021 22:03:21 +0900 Subject: [PATCH 13/20] delete req tag when release failed Signed-off-by: Ayato Tachibana --- .github/workflows/release.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8bd270db1b452..b760600437175 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -308,6 +308,11 @@ jobs: token: ${{env.HOMEBREW_TOKEN}} formula: argocd if: ${{ env.HOMEBREW_TOKEN != '' && env.UPDATE_HOMEBREW == 'true' && env.PRE_RELEASE != 'true' }} + - name: Delete original request tag from repository + run: | + set -ue + git push --delete origin ${SOURCE_TAG} + if: ${{ failure() }} push-multiarch-images: name: Perform automatic multiarch release on trigger ${{ github.ref }} From 7e1770536cd4ffffb96f9998bd0aaba82d6f5838 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Fri, 13 Aug 2021 01:58:04 +0900 Subject: [PATCH 14/20] fix manifest push Signed-off-by: Ayato Tachibana --- .../{push-multiarch-image.yaml => push-arm64-image.yaml} | 4 ++-- .github/workflows/release.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{push-multiarch-image.yaml => push-arm64-image.yaml} (96%) diff --git a/.github/workflows/push-multiarch-image.yaml b/.github/workflows/push-arm64-image.yaml similarity index 96% rename from .github/workflows/push-multiarch-image.yaml rename to .github/workflows/push-arm64-image.yaml index 5786ec1aa38ad..bd96198bc7015 100644 --- a/.github/workflows/push-multiarch-image.yaml +++ b/.github/workflows/push-arm64-image.yaml @@ -1,4 +1,4 @@ -name: Push ArgoCD multiarch image +name: Push ArgoCD arm64 image on: workflow_dispatch: @@ -9,7 +9,7 @@ on: jobs: prepare-release: - name: Perform automatic multiarch release on trigger ${{ github.event.inputs.release-tag-name }} + name: Perform automatic arm64 release on trigger ${{ github.event.inputs.release-tag-name }} runs-on: ubuntu-latest env: # The name of the tag as supplied by the GitHub event diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b760600437175..cd8525d7ba924 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -401,14 +401,14 @@ jobs: docker manifest create ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch \ --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG} \ --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 - docker push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch + docker manifest push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch # Remove the following when Docker Hub is gone docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" docker push argoproj/argocd:${RELEASE_TAG}-arm64 docker manifest create argoproj/argocd:${RELEASE_TAG}-multiarch \ --amend argoproj/argocd:${RELEASE_TAG} \ --amend argoproj/argocd:${RELEASE_TAG}-arm64 - docker push argoproj/argocd:${RELEASE_TAG}-multiarch + docker manifest push argoproj/argocd:${RELEASE_TAG}-multiarch if: ${{ env.DRY_RUN != 'true' }} - name: Delete original request tag from repository From 8b68837bf3141b21035300b71663d78c7b51253e Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Wed, 6 Oct 2021 16:11:13 +0900 Subject: [PATCH 15/20] fix workflow to run on v* pattern tags Signed-off-by: Ayato Tachibana --- .github/workflows/push-arm64-image.yaml | 14 ++-- .github/workflows/release.yaml | 102 ------------------------ 2 files changed, 6 insertions(+), 110 deletions(-) diff --git a/.github/workflows/push-arm64-image.yaml b/.github/workflows/push-arm64-image.yaml index bd96198bc7015..75ff65209c761 100644 --- a/.github/workflows/push-arm64-image.yaml +++ b/.github/workflows/push-arm64-image.yaml @@ -1,11 +1,9 @@ name: Push ArgoCD arm64 image on: - workflow_dispatch: - inputs: - release-tag-name: - description: 'The release tag name that triggers this workflow (e.g. release-v2.0.0)' - required: true + push: + tags: + - 'v*' jobs: prepare-release: @@ -30,7 +28,7 @@ jobs: set -xue # Target version must match major.minor.patch and optional -rcX suffix # where X must be a number. - TARGET_VERSION=${SOURCE_TAG#*release-v} + TARGET_VERSION=${SOURCE_TAG#*v} if ! echo "${TARGET_VERSION}" | egrep '^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)*$'; then echo "::error::Target version '${TARGET_VERSION}' is malformed, refusing to continue." >&2 exit 1 @@ -40,8 +38,8 @@ jobs: # Its name is 'release-.' TARGET_BRANCH="release-${TARGET_VERSION%\.[0-9]*}" - # The release tag is the source tag, minus the release- prefix - RELEASE_TAG="${SOURCE_TAG#*release-}" + # The release tag is the source tag + RELEASE_TAG="${SOURCE_TAG}" # Make the variables available in follow-up steps echo "TARGET_VERSION=${TARGET_VERSION}" >> $GITHUB_ENV diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7d14fec19bfab..e3a9891a39012 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -274,109 +274,7 @@ jobs: token: ${{env.HOMEBREW_TOKEN}} formula: argocd if: ${{ env.HOMEBREW_TOKEN != '' && env.UPDATE_HOMEBREW == 'true' && env.PRE_RELEASE != 'true' }} - - name: Delete original request tag from repository - run: | - set -ue - git push --delete origin ${SOURCE_TAG} - if: ${{ failure() }} - - push-multiarch-images: - name: Perform automatic multiarch release on trigger ${{ github.ref }} - runs-on: ubuntu-latest - needs: prepare-release - env: - # The name of the tag as supplied by the GitHub event - SOURCE_TAG: ${{ github.ref }} - # The image namespace where Docker image will be published to - IMAGE_NAMESPACE: quay.io/argoproj - # Whether to create & push image and release assets - DRY_RUN: false - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Check if the published tag is well formed and setup vars - run: | - set -xue - # Target version must match major.minor.patch and optional -rcX suffix - # where X must be a number. - TARGET_VERSION=${SOURCE_TAG#*release-v} - if ! echo "${TARGET_VERSION}" | egrep '^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)*$'; then - echo "::error::Target version '${TARGET_VERSION}' is malformed, refusing to continue." >&2 - exit 1 - fi - - # Target branch is the release branch we're going to operate on - # Its name is 'release-.' - TARGET_BRANCH="release-${TARGET_VERSION%\.[0-9]*}" - # The release tag is the source tag, minus the release- prefix - RELEASE_TAG="${SOURCE_TAG#*release-}" - - # Make the variables available in follow-up steps - echo "TARGET_VERSION=${TARGET_VERSION}" >> $GITHUB_ENV - echo "TARGET_BRANCH=${TARGET_BRANCH}" >> $GITHUB_ENV - echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV - - - name: Checkout corresponding release branch - run: | - set -ue - echo "Switching to release branch '${TARGET_BRANCH}'" - if ! git checkout ${TARGET_BRANCH}; then - echo "::error::Checking out release branch '${TARGET_BRANCH}' for target version '${TARGET_VERSION}' (tagged '${RELEASE_TAG}') failed. Does it exist in repo?" - exit 1 - fi - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - with: - platforms: arm64 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Build arm64 Docker image for release - uses: docker/build-push-action@v2 - with: - context: . - file: Dockerfile - platforms: linux/arm64 - tags: | - ${{ env.IMAGE_NAMESPACE }}/argocd:${{ env.RELEASE_TAG }}-arm64 - argoproj/argocd:${{ env.RELEASE_TAG }}-arm64 - build-args: | - BUILD_ALL_CLIS=false - load: true - if: ${{ env.DRY_RUN != 'true' }} - - - name: Push docker image and multiarch manifest to repository - env: - DOCKER_USERNAME: ${{ secrets.RELEASE_DOCKERHUB_USERNAME }} - DOCKER_TOKEN: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }} - QUAY_USERNAME: ${{ secrets.RELEASE_QUAY_USERNAME }} - QUAY_TOKEN: ${{ secrets.RELEASE_QUAY_TOKEN }} - run: | - set -ue - docker login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_TOKEN}" - docker push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 - # Create docker multi-arch manifest - docker manifest create ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch \ - --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG} \ - --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 - docker manifest push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch - # Remove the following when Docker Hub is gone - docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" - docker push argoproj/argocd:${RELEASE_TAG}-arm64 - docker manifest create argoproj/argocd:${RELEASE_TAG}-multiarch \ - --amend argoproj/argocd:${RELEASE_TAG} \ - --amend argoproj/argocd:${RELEASE_TAG}-arm64 - docker manifest push argoproj/argocd:${RELEASE_TAG}-multiarch - if: ${{ env.DRY_RUN != 'true' }} - - name: Delete original request tag from repository run: | set -ue From 5575915981545a7689550d49ead4741707c16a5c Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Wed, 6 Oct 2021 16:41:41 +0900 Subject: [PATCH 16/20] fix workflow to publish multiarch image Signed-off-by: Ayato Tachibana --- ...64-image.yaml => publish-multiarch-image.yaml} | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) rename .github/workflows/{push-arm64-image.yaml => publish-multiarch-image.yaml} (81%) diff --git a/.github/workflows/push-arm64-image.yaml b/.github/workflows/publish-multiarch-image.yaml similarity index 81% rename from .github/workflows/push-arm64-image.yaml rename to .github/workflows/publish-multiarch-image.yaml index 75ff65209c761..5d1f2bc93ca80 100644 --- a/.github/workflows/push-arm64-image.yaml +++ b/.github/workflows/publish-multiarch-image.yaml @@ -1,4 +1,4 @@ -name: Push ArgoCD arm64 image +name: Publish ArgoCD multiarch image on: push: @@ -6,8 +6,8 @@ on: - 'v*' jobs: - prepare-release: - name: Perform automatic arm64 release on trigger ${{ github.event.inputs.release-tag-name }} + publish-multiarch-image: + name: Perform automatic multiarch release on trigger ${{ github.event.inputs.release-tag-name }} runs-on: ubuntu-latest env: # The name of the tag as supplied by the GitHub event @@ -88,8 +88,17 @@ jobs: set -ue docker login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_TOKEN}" docker push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 + # Create docker multi-arch manifest + docker manifest create ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch \ + --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG} \ + --amend ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-arm64 + docker manifest push ${IMAGE_NAMESPACE}/argocd:${RELEASE_TAG}-multiarch # Remove the following when Docker Hub is gone docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" docker push argoproj/argocd:${RELEASE_TAG}-arm64 + docker manifest create argoproj/argocd:${RELEASE_TAG}-multiarch \ + --amend argoproj/argocd:${RELEASE_TAG} \ + --amend argoproj/argocd:${RELEASE_TAG}-arm64 + docker manifest push argoproj/argocd:${RELEASE_TAG}-multiarch if: ${{ env.DRY_RUN != 'true' }} From 96d4afe3ccbc4993f0dda1c4b702a9bdcc75fab2 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Fri, 5 Nov 2021 15:51:17 +0900 Subject: [PATCH 17/20] use PAT fortag push Signed-off-by: Ayato Tachibana --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e3a9891a39012..4e05e3a5cc184 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -216,6 +216,8 @@ jobs: path: ${{ env.RELEASE_NOTES }} - name: Push changes to release branch + env: + GITHUB_TOKEN: ${{ secrets.ARGOBOT_PERSONAL_TOKEN }} run: | set -ue git push origin ${TARGET_BRANCH} From 0d4b79d0c5046890398ef1ff1816ed46c378dd01 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 11 Nov 2021 19:55:54 +0900 Subject: [PATCH 18/20] fix PAT setting Signed-off-by: Ayato Tachibana --- .github/workflows/release.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4e05e3a5cc184..23035e25786a4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -40,7 +40,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.ARGOBOT_PERSONAL_TOKEN }} - name: Check if the published tag is well formed and setup vars run: | @@ -216,8 +216,6 @@ jobs: path: ${{ env.RELEASE_NOTES }} - name: Push changes to release branch - env: - GITHUB_TOKEN: ${{ secrets.ARGOBOT_PERSONAL_TOKEN }} run: | set -ue git push origin ${TARGET_BRANCH} From bdc0a39475ba352bc76ab3470d8b426ce65fd7af Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 11 Nov 2021 20:24:39 +0900 Subject: [PATCH 19/20] fix SOURCE_TAG Signed-off-by: Ayato Tachibana --- .github/workflows/publish-multiarch-image.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-multiarch-image.yaml b/.github/workflows/publish-multiarch-image.yaml index 5d1f2bc93ca80..6d92a39ea76f6 100644 --- a/.github/workflows/publish-multiarch-image.yaml +++ b/.github/workflows/publish-multiarch-image.yaml @@ -7,11 +7,11 @@ on: jobs: publish-multiarch-image: - name: Perform automatic multiarch release on trigger ${{ github.event.inputs.release-tag-name }} + name: Perform automatic multiarch release on trigger ${{ github.ref }} runs-on: ubuntu-latest env: # The name of the tag as supplied by the GitHub event - SOURCE_TAG: ${{ github.event.inputs.release-tag-name }} + SOURCE_TAG: ${{ github.ref }} # The image namespace where Docker image will be published to IMAGE_NAMESPACE: quay.io/argoproj # Whether to create & push image and release assets From 71d5faea9cdea750dfe5322706448cb92f1b6490 Mon Sep 17 00:00:00 2001 From: Ayato Tachibana Date: Thu, 11 Nov 2021 23:19:46 +0900 Subject: [PATCH 20/20] fix RELEASE_TAG Signed-off-by: Ayato Tachibana --- .github/workflows/publish-multiarch-image.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-multiarch-image.yaml b/.github/workflows/publish-multiarch-image.yaml index 6d92a39ea76f6..8003b88cd0055 100644 --- a/.github/workflows/publish-multiarch-image.yaml +++ b/.github/workflows/publish-multiarch-image.yaml @@ -28,7 +28,7 @@ jobs: set -xue # Target version must match major.minor.patch and optional -rcX suffix # where X must be a number. - TARGET_VERSION=${SOURCE_TAG#*v} + TARGET_VERSION=${SOURCE_TAG#refs/tags/v} if ! echo "${TARGET_VERSION}" | egrep '^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)*$'; then echo "::error::Target version '${TARGET_VERSION}' is malformed, refusing to continue." >&2 exit 1 @@ -39,7 +39,7 @@ jobs: TARGET_BRANCH="release-${TARGET_VERSION%\.[0-9]*}" # The release tag is the source tag - RELEASE_TAG="${SOURCE_TAG}" + RELEASE_TAG="${SOURCE_TAG#refs/tags/}" # Make the variables available in follow-up steps echo "TARGET_VERSION=${TARGET_VERSION}" >> $GITHUB_ENV