Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
30 changes: 10 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Loading