From fbd10af09bd1460099a22491cbf3d09b9c5d78f7 Mon Sep 17 00:00:00 2001 From: kranurag7 <81210977+kranurag7@users.noreply.github.com> Date: Thu, 25 Jan 2024 08:01:59 +0530 Subject: [PATCH] build(ci): release artifacts for freebsd (#1192) Signed-off-by: Anurag <81210977+kranurag7@users.noreply.github.com> --- .goreleaser.yml | 11 +++++++++++ Makefile | 10 +++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 3bb03d4bd..c85806537 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -24,6 +24,7 @@ builds: goos: - darwin - linux + - freebsd - windows goarch: - amd64 @@ -35,6 +36,16 @@ builds: goarm: - '7' ignore: + - goos: freebsd + goarch: arm64 + - goos: freebsd + goarch: arm + - goos: freebsd + goarch: ppc64le + - goos: freebsd + goarch: riscv64 + - goos: freebsd + goarch: s390x - goos: windows goarch: arm64 - goos: windows diff --git a/Makefile b/Makefile index 2261cebb0..ca72c5b4b 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ GIT_TAG = $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null) GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean") GO_EXE = go -TARGET_OBJS ?= checksums.txt darwin_amd64.tar.gz darwin_arm64.tar.gz linux_amd64.tar.gz linux_arm64.tar.gz linux_armv7.tar.gz linux_s390x.tar.gz linux_ppc64le.tar.gz linux_riscv64.tar.gz windows_amd64.zip +TARGET_OBJS ?= checksums.txt darwin_amd64.tar.gz darwin_arm64.tar.gz linux_amd64.tar.gz linux_arm64.tar.gz linux_armv7.tar.gz linux_s390x.tar.gz linux_ppc64le.tar.gz linux_riscv64.tar.gz windows_amd64.zip freebsd_amd64.tar.gz LDFLAGS = -w ifdef VERSION @@ -112,6 +112,14 @@ build-windows-arm64: ## build for windows arm64 GOARCH=arm64 CGO_ENABLED=0 GOOS=windows $(GO_EXE) build -v --ldflags="$(LDFLAGS)" \ -o bin/windows/arm64/$(CLI_EXE).exe $(CLI_PKG) +.PHONY: build-freebsd +build-freebsd: build-freebsd-amd64 ## build all freebsd architectures + +.PHONY: build-freebsd-amd64 +build-freebsd-amd64: ## build for freebsd amd64 + GOARCH=amd64 CGO_ENABLED=0 GOOS=freebsd $(GO_EXE) build -v --ldflags="$(LDFLAGS)" \ + -o bin/freebsd/amd64/$(CLI_EXE) $(CLI_PKG) + .PHONY: check-encoding check-encoding: ## check file CR/LF encoding ! find cmd internal -name "*.go" -type f -exec file "{}" ";" | grep CRLF