Pull request: all: improve prerelease version selection

Merge in DNS/adguard-home from fix-prereleases to master

Squashed commit of the following:

commit 34424e41a0d4f1e22a0dede91e0de1b463d08a0a
Merge: 02e832fc0 6f50a4c96
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Dec 24 17:46:43 2020 +0300

    Merge branch 'master' into fix-prereleases

commit 02e832fc02dc197e40997bf566081b6d8f54420e
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Dec 23 17:27:37 2020 +0300

    all: improve prerelease version selection
This commit is contained in:
Ainar Garipov 2020-12-24 18:02:56 +03:00
parent 6f50a4c964
commit 9fb6bf82c7

View file

@ -67,10 +67,11 @@ endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
TAG_NAME=$(shell git describe --abbrev=0 | cut -c 1-8)
RELEASE_VERSION=$(TAG_NAME)
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
@ -78,6 +79,8 @@ VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif