diff options
| -rw-r--r-- | Makefile | 13 | ||||
| -rw-r--r-- | ciigo.go | 3 | ||||
| -rw-r--r-- | cmd/ciigo/main.go | 4 |
3 files changed, 10 insertions, 10 deletions
@@ -2,25 +2,26 @@ ## SPDX-License-Identifier: GPL-3.0-or-later .PHONY: all lint test install build -.FORCE: -DIR_BUILD=_bin +VERSION:=$(shell git describe --tags) +LDFLAGS:=-ldflags "-s -w -X 'git.sr.ht/~shulhan/ciigo.Version=$(VERSION)'" +DIR_BUILD:=_bin all: test lint build lint: - golangci-lint run ./... + -golangci-lint run ./... test: go run ./cmd/ciigo-example embed CGO_ENABLED=1 go test -v -race ./... -install: - go install ./cmd/ciigo +install: build + mv _bin/ciigo $(GOBIN) run-example: DEBUG=1 go run ./cmd/ciigo-example build: mkdir -p $(DIR_BUILD) - CGO_ENABLED=0 go build -o $(DIR_BUILD) ./cmd/... + CGO_ENABLED=0 go build $(LDFLAGS) -o $(DIR_BUILD) ./cmd/... @@ -25,8 +25,9 @@ const ( internalTemplatePath = `_internal/.template` ) -// nolint: gochecknoglobals var ( + Version = `0.8.2` + defExcludes = []string{ `.*\.adoc$`, `^\..*`, diff --git a/cmd/ciigo/main.go b/cmd/ciigo/main.go index fd97e99..8901b91 100644 --- a/cmd/ciigo/main.go +++ b/cmd/ciigo/main.go @@ -44,8 +44,6 @@ const ( cmdHelp = "help" cmdServe = "serve" cmdVersion = "version" - - version = "0.8.2" ) func main() { @@ -109,7 +107,7 @@ func main() { err = ciigo.Serve(&serveOpts) case cmdVersion: - fmt.Println(version) + fmt.Println(ciigo.Version) default: usage() |
