From 970e17236c14db65b428a4be10e5ea78e0f6e0d0 Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Thu, 13 Jul 2017 15:47:40 -0700 Subject: README: Fixed version badge to pull from Git tags --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ca457d..d69cc07 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # fscrypt -[![Go project version](https://badge.fury.io/go/github.com%2Fgoogle%2Ffscrypt.svg)](https://badge.fury.io/go/github.com%2Fgoogle%2Ffscrypt) +[![GitHub version](https://badge.fury.io/gh/google%2Ffscrypt.svg)](https://github.com/google/fscrypt/releases) [![GoDoc](https://godoc.org/github.com/google/fscrypt?status.svg)](https://godoc.org/github.com/google/fscrypt) [![Go Report Card](https://goreportcard.com/badge/github.com/google/fscrypt)](https://goreportcard.com/report/github.com/google/fscrypt) -- cgit v1.2.3 From d54a42b8646a4ee8c030f316803539ecff3d297d Mon Sep 17 00:00:00 2001 From: "Joe Richey joerichey@google.com" Date: Thu, 13 Jul 2017 18:46:18 -0700 Subject: Makefile: version and data now pulled in directly --- Makefile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index dc24e67..56b3646 100644 --- a/Makefile +++ b/Makefile @@ -16,13 +16,6 @@ # the License. NAME = fscrypt -# VERSION is formatted as .. -# Bugfix releases resolve issues in existing features. -# Minor releases introduce new features. -# Major releases may introduce breaking changes to the API. -VERSION = 0.1.0 -# Holds a formatted string of the build time -BUILD_TIME = $(shell date) CFLAGS += -O2 -Wall CMD_DIR = github.com/google/$(NAME)/cmd/$(NAME) @@ -39,10 +32,10 @@ CMD_DIR = github.com/google/$(NAME)/cmd/$(NAME) # Set the C flags so we don't need to set C flags in each CGO file. export CGO_CFLAGS = $(CFLAGS) -# Pass the version to the command line program -VERSION_FLAG = -X "main.version=$(VERSION)" +# Pass the version to the command line program (pulled from tags) +VERSION_FLAG = -X "main.version=$(shell git describe --tags)" # Pass the current date and time to the command line program -DATE_FLAG = -X "main.buildTime=$(BUILD_TIME)" +DATE_FLAG = -X "main.buildTime=$(shell date)" # Pass the C linking flags into Go GO_LINK_FLAGS += -s -w $(VERSION_FLAG) $(DATE_FLAG) -extldflags "$(LDFLAGS)" GOFLAGS += --ldflags '$(GO_LINK_FLAGS)' -- cgit v1.2.3