From c2fd173fe945ea7b9ad11f0ce5118c5e59254349 Mon Sep 17 00:00:00 2001 From: Markus Opolka Date: Thu, 30 Apr 2026 15:56:14 +0200 Subject: [PATCH 1/2] Update Makefile Normalize to other NETWAYS repos --- Makefile | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 233f643..a2fb784 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,13 @@ -GIT_COMMIT := $(shell git rev-list -1 HEAD) -DATE := $(shell date --iso-8601=seconds) -GO_BUILD := go build -v -ldflags "-X main.commit=$(GIT_COMMIT) -X main.date=$(DATE) -X main.builtBy=make" - -NAME = check_by_powershell - -.PHONY: all clean build test - -all: build test - -distclean: clean -clean: - rm -rf build/ +.PHONY: test coverage lint vet build: - mkdir -p build - GOOS=linux GOARCH=amd64 $(GO_BUILD) -o build/$(NAME)-linux-amd64 . - GOOS=linux GOARCH=386 $(GO_BUILD) -o build/$(NAME)-linux-i386 . - GOOS=windows GOARCH=amd64 $(GO_BUILD) -o build/$(NAME)-windows-amd64.exe . - GOOS=darwin GOARCH=amd64 $(GO_BUILD) -o build/$(NAME)-darwin-amd64 . - + CGO_ENABLED=0 go build +lint: + go fmt $(go list ./... | grep -v /vendor/) +vet: + go vet $(go list ./... | grep -v /vendor/) test: - go test -v ./... + go test -v -cover ./... +coverage: + go test -v -cover -coverprofile=coverage.out ./... &&\ + go tool cover -html=coverage.out -o coverage.html From 0291e14bca068a8cf21d34a04a1eae6608563cee Mon Sep 17 00:00:00 2001 From: Markus Opolka Date: Thu, 30 Apr 2026 15:56:39 +0200 Subject: [PATCH 2/2] Update goreleaser config --- .goreleaser.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 38e7b6a..d4569ca 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -4,22 +4,39 @@ before: hooks: - go mod download builds: - - goos: + - env: + - CGO_ENABLED=0 + goarch: + - amd64 + - arm64 + goos: - linux - windows - darwin - env: - - CGO_ENABLED=0 + ldflags: + - >- + -s -w -X main.version={{.Version}} + -X main.commit={{.Commit}} + -X main.date={{.CommitDate}} release: + draft: true github: - owner: Icinga + owner: NETWAYS name: check_by_powershell archives: - - format: binary + - formats: + - binary + name_template: >- + {{ .ProjectName }}_{{ .Tag }}_ + {{- if eq .Os "linux" }}Linux{{ end }} + {{- if eq .Os "windows" }}Windows{{ end }} + {{- if eq .Os "darwin" }}Darwin{{ end }} + {{- if eq .Arch "amd64" }}_x86_64{{ end }} + {{- if eq .Arch "arm64" }}_arm64{{ end }} checksum: name_template: 'checksums.txt' snapshot: - name_template: '{{ .Tag }}-SNAPSHOT-{{.ShortCommit}}' + version_template: '{{ .Tag }}-SNAPSHOT-{{.ShortCommit}}' changelog: sort: asc filters: