packaging: move some parts of the hooks to the Makefile

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel
2022-09-09 18:32:26 +02:00
parent 07c8047fac
commit acf0f7670a
3 changed files with 24 additions and 4 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
build/
completions/
.vscode/
dist/
/cunicu

View File

@@ -3,8 +3,7 @@ project_name: cunicu
before:
hooks:
- go mod tidy
- go generate ./...
- make prepare-release
checksum:
name_template: "checksums.txt"

View File

@@ -49,6 +49,12 @@ tests-watch:
( while inotifywait -qqe close_write --include "\.out$$" .; do $(MAKE) -sB coverage; done & )
ginkgo watch $(GINKGO_OPTS)
tidy:
go mod tidy
generate:
go generate ./...
vet:
go vet --copylocks=false $(PKGS)
@@ -64,10 +70,24 @@ install-deps:
go install github.com/amobe/gocov-merger@latest
go install github.com/jandelgado/gcov2lcov@latest
docs: $(wildcard cmd/cunicu/*.go)
rm -rf ./docs/usage/{man,md}
go run ./cmd/cunicu/ docs
completions: completions/cunicu.bash completions/cunicu.zsh completions/cunicu.fish
completions-dir:
mkdir completions
completions/cunicu.%: completions-dir
go run ./cmd/cunicu/ completion $* > $@
prepare: clean tidy generate vet staticcheck docs completions
ci: install-deps vet staticcheck tests
clean:
find . -name "*.out" -exec rm {} \;
rm -rf cunicu lcov.info test/logs/
rm -rf cunicu lcov.info test/logs/ completions/
.PHONY: all cunicu tests tests-watch coverage clean vet staticcheck install-deps ci
.PHONY: all cunicu tests tests-watch coverage clean vet staticcheck install-deps ci completions docs prepare generate