From d7ab01063a3143a9dfe5a2c0eb07112f7cb638c8 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Mon, 31 May 2021 22:11:43 +0100 Subject: [PATCH] apt: Use commit count to fix version comparisons previous fix only worked because the numerical portion of the commit hash happened to be greater. This should do properly fix it. --- .goreleaser.yml | 2 +- scripts/version.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index e39ab47..e9607d8 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -101,7 +101,7 @@ archives: checksum: name_template: 'checksums.txt' snapshot: - name_template: "0{{.ShortCommit}}" + name_template: "0.0.0-{{ .Env.JFA_GO_NFPM_EPOCH }}" changelog: sort: asc filters: diff --git a/scripts/version.sh b/scripts/version.sh index f2dd284..a88442c 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -2,4 +2,4 @@ # sets version environment variable for goreleaser to use # scripts/version.sh goreleaser ... JFA_GO_VERSION=$(git describe --exact-match HEAD 2> /dev/null || echo 'vgit') -JFA_GO_VERSION="$(echo $JFA_GO_VERSION | sed 's/v//g')" $@ +JFA_GO_NFPM_EPOCH=$(git rev-list --all --count) JFA_GO_VERSION="$(echo $JFA_GO_VERSION | sed 's/v//g')" $@