From e2738fdf3f2cab3c4832bc3173c6cebd36379443 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Thu, 10 Dec 2020 14:49:11 +0300 Subject: [PATCH] Pull request: all: fix snapshot release version length Merge in DNS/adguard-home from 2410-fix-snapshot to master Updates #2410. Updates #2412. Squashed commit of the following: commit 6718e018533abbd02ccefdb5a0030655d5e8012a Merge: ba5fc4c58 e02308dd4 Author: Ainar Garipov Date: Thu Dec 10 14:36:19 2020 +0300 Merge branch 'master' into 2410-fix-snapshot commit ba5fc4c58b1f2be0b3e6fbbeea04f70b506633f2 Author: Ainar Garipov Date: Thu Dec 10 13:12:12 2020 +0300 all: fix snapshot release version length --- .goreleaser.yml | 8 ++++++++ Makefile | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 7c132f87..c533712b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -105,3 +105,11 @@ 'checksum': 'name_template': 'checksums.txt' + +'snapshot': + # TODO(a.garipov): A temporary solution to trim the prerelease versions. + # A real solution would consist of making a better versioning scheme that also + # doesn't break SemVer or Snapcraft. + # + # See https://github.com/AdguardTeam/AdGuardHome/issues/2412. + 'name_template': '{{ slice .Tag 0 8 }}-SNAPSHOT-{{ .ShortCommit }}' diff --git a/Makefile b/Makefile index 683a92b1..1848fe34 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,9 @@ endif # Version properties COMMIT=$(shell git rev-parse --short HEAD) -TAG_NAME=$(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) SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)