diff --git a/Makefile b/Makefile index 9ca469c96e7..c459ed9e0eb 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ APP := miniflux DOCKER_IMAGE := miniflux/miniflux -VERSION := $(shell git describe --abbrev=0) +VERSION := $(shell git describe --tags --abbrev=0) COMMIT := $(shell git rev-parse --short HEAD) BUILD_DATE := `date +%FT%T%z` LD_FLAGS := "-s -w -X 'miniflux.app/version.Version=$(VERSION)' -X 'miniflux.app/version.Commit=$(COMMIT)' -X 'miniflux.app/version.BuildDate=$(BUILD_DATE)'" diff --git a/packaging/debian/build.sh b/packaging/debian/build.sh index 00940b59607..047f4cd57c1 100755 --- a/packaging/debian/build.sh +++ b/packaging/debian/build.sh @@ -2,7 +2,7 @@ PKG_ARCH=`dpkg --print-architecture` PKG_DATE=`date -R` -PKG_VERSION=`cd /src && git describe --abbrev=0` +PKG_VERSION=`cd /src && git describe --tags --abbrev=0` echo "PKG_VERSION=$PKG_VERSION" echo "PKG_ARCH=$PKG_ARCH" diff --git a/packaging/docker/Dockerfile b/packaging/docker/Dockerfile index ddd1a9bc1f3..912e9dfab8b 100644 --- a/packaging/docker/Dockerfile +++ b/packaging/docker/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /go/src/app RUN go generate RUN go build \ -o miniflux \ - -ldflags="-s -w -X 'miniflux.app/version.Version=`git describe --abbrev=0`' -X 'miniflux.app/version.Commit=`git rev-parse --short HEAD`' -X 'miniflux.app/version.BuildDate=`date +%FT%T%z`'" \ + -ldflags="-s -w -X 'miniflux.app/version.Version=`git describe --tags --abbrev=0`' -X 'miniflux.app/version.Commit=`git rev-parse --short HEAD`' -X 'miniflux.app/version.BuildDate=`date +%FT%T%z`'" \ main.go FROM alpine:latest diff --git a/packaging/rpm/Dockerfile b/packaging/rpm/Dockerfile index d0344bd9d59..01d3f8ee2de 100644 --- a/packaging/rpm/Dockerfile +++ b/packaging/rpm/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /go/src/app RUN go generate RUN go build \ -o miniflux \ - -ldflags="-s -w -X 'miniflux.app/version.Version=`git describe --abbrev=0`' -X 'miniflux.app/version.Commit=`git rev-parse --short HEAD`' -X 'miniflux.app/version.BuildDate=`date +%FT%T%z`'" \ + -ldflags="-s -w -X 'miniflux.app/version.Version=`git describe --tags --abbrev=0`' -X 'miniflux.app/version.Commit=`git rev-parse --short HEAD`' -X 'miniflux.app/version.BuildDate=`date +%FT%T%z`'" \ main.go FROM centos:latest