Skip to content

Commit

Permalink
test release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasferrandiz committed Nov 27, 2023
1 parent a35bc4b commit 3144631
Showing 1 changed file with 120 additions and 120 deletions.
240 changes: 120 additions & 120 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

0 comments on commit 3144631

Please sign in to comment.