diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f66f8a9..526237ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,8 +14,6 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 - with: - fetch-tags: true - name: Set up Go uses: actions/setup-go@v5 with: @@ -30,10 +28,11 @@ jobs: run: make build - name: Build binaries for arm64 run: GOARCH=arm64 make build - - name: Tag and push ClusterLink images with tag 'latest' - run: PLATFORMS=linux/amd64,linux/arm64 make push-image - - name: Tag and push ClusterLink images latest with tag ${{ github.ref_name }} - run: PLATFORMS=linux/amd64,linux/arm64 make push-image IMAGE_VERSION=${{ github.ref_name }} + - name: Tag and push ClusterLink images with tag 'latest' and ${{ github.ref_name }} + run: | + docker buildx create --use --driver docker-container + PLATFORMS=linux/amd64,linux/arm64 make push-image + PLATFORMS=linux/amd64,linux/arm64 make push-image IMAGE_VERSION=${{ github.ref_name }} - name: Build and compress binaries run: | for pair in "linux:amd64" "linux:arm64" "darwin:amd64" "darwin:arm64"; do diff --git a/Makefile b/Makefile index 4168d73d..dd58ccf5 100755 --- a/Makefile +++ b/Makefile @@ -2,8 +2,8 @@ SHELL=/bin/bash IMAGE_VERSION ?= latest IMAGE_ORG ?= clusterlink-net -IMAGE_BASE ?= ghcr.io/$(IMAGE_ORG) -PLATFORMS ?= linux/amd64 +IMAGE_BASE ?= ghcr.io/kfirtoledo +PLATFORMS ?= linux/amd64,linux/arm64 GOARCH ?=amd64 #----------------------------------------------------------------------------- # Target: clean @@ -88,7 +88,7 @@ BIN_DIR := ./bin VERSION_FLAG := -X 'github.com/clusterlink-net/clusterlink/pkg/versioninfo.GitTag=$(shell git describe --tags --abbrev=0)' REVISION_FLAG := -X 'github.com/clusterlink-net/clusterlink/pkg/versioninfo.Revision=$(shell git rev-parse --short HEAD)' LD_FLAGS := -ldflags "$(VERSION_FLAG) $(REVISION_FLAG)" -BUILDX_NO_DEFAULT_ATTESTATIONS := 1 # Disable default attestations during Docker builds to prevent "unknown/unknown" image in ghcr. +export BUILDX_NO_DEFAULT_ATTESTATIONS := 1# Disable default attestations during Docker builds to prevent "unknown/unknown" image in ghcr. # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) @@ -133,10 +133,10 @@ docker-build: build docker build --platform $(PLATFORMS) --progress=plain --rm --tag cl-operator -f ./cmd/cl-operator/Dockerfile . push-image: build - docker buildx build --platform $(PLATFORMS) --progress=plain --rm --tag $(IMAGE_BASE)/cl-controlplane:$(IMAGE_VERSION) --push -f ./cmd/cl-controlplane/Dockerfile . - docker buildx build --platform $(PLATFORMS) --progress=plain --rm --tag $(IMAGE_BASE)/cl-go-dataplane:$(IMAGE_VERSION) --push -f ./cmd/cl-go-dataplane/Dockerfile . - docker buildx build --platform $(PLATFORMS) --progress=plain --rm --tag $(IMAGE_BASE)/cl-dataplane:$(IMAGE_VERSION) --push -f ./cmd/cl-dataplane/Dockerfile . - docker buildx build --platform $(PLATFORMS) --progress=plain --rm --tag $(IMAGE_BASE)/cl-operator:$(IMAGE_VERSION) --push -f ./cmd/cl-operator/Dockerfile . +# # docker buildx build --platform $(PLATFORMS) --progress=plain --rm --tag $(IMAGE_BASE)/cl-controlplane:$(IMAGE_VERSION) --push -f ./cmd/cl-controlplane/Dockerfile . +# # docker buildx build --platform $(PLATFORMS) --progress=plain --rm --tag $(IMAGE_BASE)/cl-go-dataplane:$(IMAGE_VERSION) --push -f ./cmd/cl-go-dataplane/Dockerfile . +# # docker buildx build --platform $(PLATFORMS) --progress=plain --rm --tag $(IMAGE_BASE)/cl-dataplane:$(IMAGE_VERSION) --push -f ./cmd/cl-dataplane/Dockerfile . +# # docker buildx build --platform $(PLATFORMS) --progress=plain --rm --tag $(IMAGE_BASE)/cl-operator:$(IMAGE_VERSION) --push -f ./cmd/cl-operator/Dockerfile . docker buildx build --platform $(PLATFORMS) --progress=plain --rm --tag $(IMAGE_BASE)/gwctl:$(IMAGE_VERSION) --push -f ./cmd/gwctl/Dockerfile . install: