feat: build with safe tag

This commit is contained in:
Kevin Franklin Kim 2025-05-16 16:31:10 +02:00
parent 924bc01c07
commit 680e0cdd33
No known key found for this signature in database
2 changed files with 14 additions and 14 deletions

View File

@ -1,3 +1,5 @@
version: 2
project_name: contentserver project_name: contentserver
release: release:
@ -8,6 +10,9 @@ release:
builds: builds:
- binary: contentserver - binary: contentserver
main: ./main.go
env:
- CGO_ENABLED=0
goos: goos:
- windows - windows
- darwin - darwin
@ -17,35 +22,30 @@ builds:
- arm64 - arm64
goarm: goarm:
- '7' - '7'
env:
- CGO_ENABLED=0
main: ./main.go
flags: flags:
- -trimpath - -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: archives:
- format: tar.gz - format: tar.gz
format_overrides: format_overrides:
- goos: windows - goos: windows
format: zip format: zip
files:
- LICENSE
- README.md
changelog: changelog:
use: github-native use: github-native
brews: brews:
# Repository to push the tap to.
- repository: - repository:
owner: foomo owner: foomo
name: homebrew-tap name: homebrew-tap
caveats: "sesamy --help" caveats: "contentserver --help"
homepage: "https://github.com/foomo/contentserver" homepage: "https://github.com/foomo/contentserver"
description: "Serves content tree structures very quickly" description: "Serves content tree structures very quickly"
test: | test: |
system "#{bin}/contentserver --version" system "#{bin}/contentserver version"
dockers: dockers:
- use: buildx - use: buildx

View File

@ -27,12 +27,12 @@ doc:
.PHONY: test .PHONY: test
## Run tests ## Run tests
test: 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 .PHONY: test.update
## Run tests and update snapshots ## Run tests and update snapshots
test.update: 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 .PHONY: lint
## Run linter ## Run linter
@ -57,13 +57,13 @@ outdated:
.PHONY: install .PHONY: install
## Install binary ## Install binary
install: install:
@go build -o ${GOPATH}/bin/contentserver main.go @go build -tags=safe -o ${GOPATH}/bin/contentserver main.go
.PHONY: build .PHONY: build
## Build binary ## Build binary
build: build:
@mkdir -p bin @mkdir -p bin
@go build -o bin/contentserver main.go @go build -tags=safe -o bin/contentserver main.go
## === Utils === ## === Utils ===