diff --git a/Makefile b/Makefile index 16e8c2e..aeb0267 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,14 @@ -BINARY_NAME=humble-bot -default: build - +# Set the default Go build flags +#GOFLAGS = -ldflags='-w -s -X cmd.Version=$(VERSION)' +GOFLAGS = -ldflags='-w -s' + +# Build the application build: - go build -o ${BINARY_NAME} main.go - + go build $(GOFLAGS) -o bin/humble-bot main.go + +# Clean the build artifacts clean: - go clean - rm ${BINARY_NAME} + rm -rf bin + +# Set a version for the build +VERSION := $(shell git describe --tags --always) diff --git a/constants/constants.go b/constants/constants.go index 8ab356e..88602e8 100644 --- a/constants/constants.go +++ b/constants/constants.go @@ -6,7 +6,7 @@ package constants -var AppVersion = "0.2.1" +var AppVersion string var HumbleCategories = []string{"games", "books", "software"}