From 680e0cdd332ab5afcf3bb6efc8032047ffb9b6c0 Mon Sep 17 00:00:00 2001 From: Kevin Franklin Kim Date: Fri, 16 May 2025 16:31:10 +0200 Subject: [PATCH] feat: build with safe tag --- .goreleaser.yml | 20 ++++++++++---------- Makefile | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 4c2ff31..a71472a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,5 @@ +version: 2 + project_name: contentserver release: @@ -8,6 +10,9 @@ release: builds: - binary: contentserver + main: ./main.go + env: + - CGO_ENABLED=0 goos: - windows - darwin @@ -17,35 +22,30 @@ builds: - arm64 goarm: - '7' - env: - - CGO_ENABLED=0 - main: ./main.go flags: - -trimpath - ldflags: -s -w -X github.com/foomo/contentserver/cmd.version={{.Version}} + - -tags=safe + ldflags: + - -s -w -X github.com/foomo/contentserver/cmd.version={{.Version}} archives: - format: tar.gz format_overrides: - goos: windows format: zip - files: - - LICENSE - - README.md changelog: use: github-native brews: - # Repository to push the tap to. - repository: owner: foomo name: homebrew-tap - caveats: "sesamy --help" + caveats: "contentserver --help" homepage: "https://github.com/foomo/contentserver" description: "Serves content tree structures very quickly" test: | - system "#{bin}/contentserver --version" + system "#{bin}/contentserver version" dockers: - use: buildx diff --git a/Makefile b/Makefile index 390d2dc..8d6b1f0 100644 --- a/Makefile +++ b/Makefile @@ -27,12 +27,12 @@ doc: .PHONY: test ## Run tests test: - @GO_TEST_TAGS=-skip go test -coverprofile=coverage.out -race -json ./... | gotestfmt + @GO_TEST_TAGS=-skip go test -tags=safe -coverprofile=coverage.out -race -json ./... | gotestfmt .PHONY: test.update ## Run tests and update snapshots test.update: - @GO_TEST_TAGS=-skip go test -update -coverprofile=coverage.out -race -json ./... | gotestfmt + @GO_TEST_TAGS=-skip go test -update -tags=safe -coverprofile=coverage.out -race -json ./... | gotestfmt .PHONY: lint ## Run linter @@ -57,13 +57,13 @@ outdated: .PHONY: install ## Install binary install: - @go build -o ${GOPATH}/bin/contentserver main.go + @go build -tags=safe -o ${GOPATH}/bin/contentserver main.go .PHONY: build ## Build binary build: @mkdir -p bin - @go build -o bin/contentserver main.go + @go build -tags=safe -o bin/contentserver main.go ## === Utils ===