Skip to content

Secure makefile

Secure makefile #1961

Workflow file for this run

name: build flannel
on: pull_request
env:
GO_VERSION: "1.24"
LINUX_ARCHES: "amd64 arm arm64 s390x ppc64le riscv64"
REPOSITORY: flannel/flannel
permissions:
contents: read
jobs:
build-images:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
- name: set tag
run: echo "GIT_TAG=$(git describe --tags --always)" >> $GITHUB_ENV
- name: Set up Go 1.x
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c #v6.4.0
with:
go-version: ${{ env.GO_VERSION }}
- name: go mod vendor
run: go mod vendor
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #v4.0.0
- name: Docker meta
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf #v6.0.0
with:
images: ${{ env.REPOSITORY }}
flavor: latest=false
tags: |
type=ref, event=branch
- name: Build multi-arch Docker image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 #v6.15.0
with:
context: .
file: images/Dockerfile
push: false
platforms: linux/amd64,linux/arm64,linux/arm,linux/s390x,linux/ppc64le,linux/riscv64
tags: ${{ steps.meta.outputs.tags }}
build-args: TAG=${{ env.GIT_TAG }}
- name: build for windows
run: make dist/flanneld.exe