-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c3b64c
commit d25eab8
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
before: | ||
hooks: | ||
- make clean | ||
- make deps | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
dist: bin | ||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ incpatch .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^chore:' | ||
- '^docs:' | ||
- '^test:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.PHONY: help prerequisites deps format lint test build clean | ||
.DEFAULT_GOAL := build | ||
|
||
BIN_NAME := minutes | ||
|
||
help: ## Show available targets | ||
@echo "Available targets:" | ||
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' | ||
|
||
prerequisites: ## Download and install prerequisites | ||
go install github.com/goreleaser/goreleaser@latest | ||
go install github.com/sqs/goreturns@latest | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | ||
go install github.com/securego/gosec/v2/cmd/gosec@latest | ||
|
||
deps: ## Download dependencies | ||
go mod download | ||
go mod tidy | ||
|
||
format: deps ## Run formatter on the project | ||
goreturns -b -local -p -w -e -l . | ||
|
||
lint: format ## Run linters on the project | ||
golangci-lint run --timeout 5m -E golint -e '(struct field|type|method|func) [a-zA-Z`]+ should be [a-zA-Z`]+' | ||
gosec -quiet ./... | ||
|
||
test: deps ## Run tests | ||
go test ./... | ||
|
||
build: deps ## Build binary | ||
goreleaser build --rm-dist --snapshot --single-target | ||
@find bin -name "$(BIN_NAME)" -exec cp "{}" bin/ \; | ||
|
||
release: ## Release a new version on GitHub | ||
goreleaser release --rm-dist --auto-snapshot | ||
|
||
clean: ## Clean up project root | ||
rm -rf bin/ |