From 3144631596fcb20265a07c74341b6d10d5d6290b Mon Sep 17 00:00:00 2001 From: Thomas Ferrandiz Date: Mon, 27 Nov 2023 09:53:49 +0000 Subject: [PATCH] test release workflow --- .github/workflows/release.yml | 240 +++++++++++++++++----------------- 1 file changed, 120 insertions(+), 120 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 28acfaa..e7a80e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,12 +10,10 @@ on: # description: 'Define branch name to run the release GH action against' # required: true # default: 'main' - release: - types: - - created +# TODO_TEST push: - tags: - - v1.* + # branches: + # - main env: GO_VERSION: "1.20.5" @@ -264,122 +262,124 @@ jobs: - name: Build and push Docker image for amd64 if: github.repository_owner == 'flannel-io' && success() - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: . file: Dockerfile.amd64 push: true - tags: ${{ steps.meta.outputs.tags }}-amd64 - - - name: Build and push Docker image for arm - if: github.repository_owner == 'flannel-io' - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile.arm - push: true - tags: ${{ steps.meta.outputs.tags }}-arm - - - name: Build and push Docker image for arm64 - if: github.repository_owner == 'flannel-io' - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile.arm64 - push: true - tags: ${{ steps.meta.outputs.tags }}-arm64 - - - name: Build and push Docker image for s390x - if: github.repository_owner == 'flannel-io' - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile.s390x - push: true - tags: ${{ steps.meta.outputs.tags }}-s390x - - - name: Build and push Docker image for ppc64le - if: github.repository_owner == 'flannel-io' - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile.ppc64le - push: true - tags: ${{ steps.meta.outputs.tags }}-ppc64le - - - name: Build and push Docker image for mips64le - if: github.repository_owner == 'flannel-io' - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile.mips64le - push: true - tags: ${{ steps.meta.outputs.tags }}-mips64le - - - build-and-push-multi-arch-image: - needs: [setup-go, build, test, package, release, build-and-push-images] - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - go: [ "1.20.5" ] - steps: - - name: Checkout repository - uses: actions/checkout@v3 - if: success() - - - uses: actions/setup-go@v3 - id: setup-go - with: - go-version: ${{ matrix.go }} - - - name: go mod vendor - run: go mod vendor - - - name: build linux - if: success() - run: make build_all_linux_for_images - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.REPOSITORY }} - flavor: latest=false - tags: | - type=ref,event=tag - - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Create manifest for multi-arch image - if: github.repository_owner == 'flannel-io' && success() && ${{ steps.meta.outputs.tags }} - run: | - # get artifacts from previous steps and integrate into one multi-arch manifest - docker pull ${{ steps.meta.outputs.tags }}-amd64 - docker pull ${{ steps.meta.outputs.tags }}-arm64 - docker pull ${{ steps.meta.outputs.tags }}-arm - docker pull ${{ steps.meta.outputs.tags }}-mips64le - docker pull ${{ steps.meta.outputs.tags }}-ppc64le - docker pull ${{ steps.meta.outputs.tags }}-s390x - docker manifest create ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-amd64 ${{ steps.meta.outputs.tags }}-arm64 ${{ steps.meta.outputs.tags }}-arm ${{ steps.meta.outputs.tags }}-mips64le ${{ steps.meta.outputs.tags }}-ppc64le ${{ steps.meta.outputs.tags }}-s390x - docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-amd64 --arch amd64 - docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-arm64 --arch arm64 - docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-arm --arch arm - docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-mips64le --arch mips64le - docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-ppc64le --arch ppc64le - docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-s390x --arch s390x - docker manifest push ${{ steps.meta.outputs.tags }} - docker pull ${{ steps.meta.outputs.tags }} - docker tag ${{ steps.meta.outputs.tags }} ${{ env.REPOSITORY }}:latest - docker push ${{ env.REPOSITORY }}:latest + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + + # - name: Build and push Docker image for arm + # if: github.repository_owner == 'flannel-io' + # uses: docker/build-push-action@v4 + # with: + # context: . + # file: Dockerfile.arm + # push: true + # tags: ${{ steps.meta.outputs.tags }}-arm + + # - name: Build and push Docker image for arm64 + # if: github.repository_owner == 'flannel-io' + # uses: docker/build-push-action@v4 + # with: + # context: . + # file: Dockerfile.arm64 + # push: true + # tags: ${{ steps.meta.outputs.tags }}-arm64 + + # - name: Build and push Docker image for s390x + # if: github.repository_owner == 'flannel-io' + # uses: docker/build-push-action@v4 + # with: + # context: . + # file: Dockerfile.s390x + # push: true + # tags: ${{ steps.meta.outputs.tags }}-s390x + + # - name: Build and push Docker image for ppc64le + # if: github.repository_owner == 'flannel-io' + # uses: docker/build-push-action@v4 + # with: + # context: . + # file: Dockerfile.ppc64le + # push: true + # tags: ${{ steps.meta.outputs.tags }}-ppc64le + + # - name: Build and push Docker image for mips64le + # if: github.repository_owner == 'flannel-io' + # uses: docker/build-push-action@v4 + # with: + # context: . + # file: Dockerfile.mips64le + # push: true + # tags: ${{ steps.meta.outputs.tags }}-mips64le + + + # build-and-push-multi-arch-image: + # needs: [setup-go, build, test, package, release, build-and-push-images] + # runs-on: ubuntu-latest + # strategy: + # fail-fast: true + # matrix: + # go: [ "1.20.5" ] + # steps: + # - name: Checkout repository + # uses: actions/checkout@v3 + # if: success() + + # - uses: actions/setup-go@v3 + # id: setup-go + # with: + # go-version: ${{ matrix.go }} + + # - name: go mod vendor + # run: go mod vendor + + # - name: build linux + # if: success() + # run: make build_all_linux_for_images + + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v2 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2 + + # - name: Docker meta + # id: meta + # uses: docker/metadata-action@v4 + # with: + # images: ${{ env.REPOSITORY }} + # flavor: latest=false + # tags: | + # type=ref,event=tag + + # - name: Log in to Docker Hub + # uses: docker/login-action@v2 + # with: + # username: ${{ secrets.DOCKER_USERNAME }} + # password: ${{ secrets.DOCKER_PASSWORD }} + + # - name: Create manifest for multi-arch image + # if: github.repository_owner == 'flannel-io' && success() && ${{ steps.meta.outputs.tags }} + # run: | + # # get artifacts from previous steps and integrate into one multi-arch manifest + # docker pull ${{ steps.meta.outputs.tags }}-amd64 + # docker pull ${{ steps.meta.outputs.tags }}-arm64 + # docker pull ${{ steps.meta.outputs.tags }}-arm + # docker pull ${{ steps.meta.outputs.tags }}-mips64le + # docker pull ${{ steps.meta.outputs.tags }}-ppc64le + # docker pull ${{ steps.meta.outputs.tags }}-s390x + # docker manifest create ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-amd64 ${{ steps.meta.outputs.tags }}-arm64 ${{ steps.meta.outputs.tags }}-arm ${{ steps.meta.outputs.tags }}-mips64le ${{ steps.meta.outputs.tags }}-ppc64le ${{ steps.meta.outputs.tags }}-s390x + # docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-amd64 --arch amd64 + # docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-arm64 --arch arm64 + # docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-arm --arch arm + # docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-mips64le --arch mips64le + # docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-ppc64le --arch ppc64le + # docker manifest annotate ${{ steps.meta.outputs.tags }} ${{ steps.meta.outputs.tags }}-s390x --arch s390x + # docker manifest push ${{ steps.meta.outputs.tags }} + # docker pull ${{ steps.meta.outputs.tags }} + # docker tag ${{ steps.meta.outputs.tags }} ${{ env.REPOSITORY }}:latest + # # TODO_TEST + # # docker push ${{ env.REPOSITORY }}:latest