v1.5.1-flannel2 #53
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release flannel cni-plugin | |
on: | |
# You must provide a tag either via the action input or the git ref (i.e push / create a tag). | |
# If you do not provide a tag the action will fail. | |
# If the tag of the release you are creating does not yet exist, you should set | |
# both the tag and commit action inputs. commit can point to a commit hash or a branch name (ex - main). | |
# workflow_dispatch: | |
# inputs: | |
# branch: | |
# description: 'Define branch name to run the release GH action against' | |
# required: true | |
# default: 'main' | |
release: | |
types: | |
- created | |
env: | |
GO_VERSION: "1.21.11" | |
REPOSITORY: flannel/flannel-cni-plugin | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: go mod vendor and tidy | |
run: make vendor | |
- name: build all binaries for release | |
run: make build_all | |
- name: run tests | |
run: make test_linux | |
- name: run go vet | |
run: go vet | |
- name: create packages for release | |
if: success() | |
run: make release | |
- name: Upload release files | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dist/* | |
release/* | |
build-and-push-images: | |
needs: [build-and-release] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
if: success() | |
- 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: Build and push Docker image | |
# if: github.repository_owner == 'flannel-io' && success() | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile.image | |
push: true | |
platforms: linux/amd64,linux/arm64,linux/arm,linux/s390x,linux/ppc64le,linux/riscv64 | |
tags: ${{ steps.meta.outputs.tags }} |