diff --git a/.goreleaser.yaml b/.goreleaser.yaml index ceee709..56af355 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -3,6 +3,9 @@ version: 2 before: hooks: - go mod download + - go install github.com/cpuguy83/go-md2man/v2@latest + - go-md2man -in README.md -out manpage.1 + builds: - env: - CGO_ENABLED=1 @@ -25,6 +28,7 @@ archives: - CHANGELOG.md - README.md - bin/magellan.sh + - magellan.1 dockers: - image_templates: diff --git a/Makefile b/Makefile index 67168df..3285e00 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,7 @@ inst: ## go install tools go install github.com/client9/misspell/cmd/misspell@v0.3.4 go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2 go install github.com/goreleaser/goreleaser@v1.18.2 + go install github.com/cpuguy83/go-md2man/v2@latest .PHONY: goreleaser release: ## goreleaser build @@ -103,6 +104,14 @@ emulator: $(call print-target) ./emulator/setup.sh +magellan.1: README.md inst + $(GOPATH)/bin/go-md2man -in $< -out $@ + +.PHONY: man +man: + $(call print-target) + $(MAKE) -f $(firstword $(MAKEFILE_LIST)) magellan.1 + define print-target @printf "Executing target: \033[36m$@\033[0m\n" endef