summaryrefslogtreecommitdiffstats
path: root/snap
diff options
context:
space:
mode:
authorAnthony Fok <foka@debian.org>2022-08-30 03:52:16 -0600
committerAnthony Fok <anthony.fok@canada.ca>2022-08-30 05:23:18 -0600
commit160a067c812ef127a3a06e4cdc9278b6108bb205 (patch)
tree0af91c4a0f2c473f4a7679865100fd27a118955f /snap
parente0ba1a805aaa0d0e8ca2563c498722abb2851293 (diff)
snap: Use "snapcraftctl set-grade"
This, together with 'snapcraftctl set-version", negates the need to modify snap/snapcraft.yaml upon each release, so the corresponding code is removed from releaser/releaser.go. Also, vendorInfo is extended to include the snap version number. See #10225
Diffstat (limited to 'snap')
-rw-r--r--snap/snapcraft.yaml8
1 files changed, 6 insertions, 2 deletions
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 64083bcc4..c09eb98ae 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -10,7 +10,6 @@ description: |
license: "Apache-2.0"
base: core20
confinement: strict
-grade: devel # "devel" or "stable"
adopt-info: hugo
package-repositories:
@@ -80,6 +79,11 @@ parts:
override-pull: |
snapcraftctl pull
snapcraftctl set-version "$(git describe --tags --always --match 'v[0-9]*' | sed 's/^v//; s/-/+git/; s/-g/./')"
+ if grep -q 'Suffix:\s*""' common/hugo/version_current.go; then
+ snapcraftctl set-grade "stable"
+ else
+ snapcraftctl set-grade "devel"
+ fi
override-build: |
echo "\nStarting override-build:"
set -ex
@@ -104,7 +108,7 @@ parts:
fi
echo " * Building hugo (HUGO_BUILD_TAGS=\"$HUGO_BUILD_TAGS\")..."
- go build -v -ldflags '-X github.com/gohugoio/hugo/common/hugo.vendorInfo=snap' -tags "$HUGO_BUILD_TAGS"
+ go build -v -ldflags "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=snap:$(git describe --tags --always --match 'v[0-9]*' | sed 's/^v//; s/-/+git/; s/-g/./')" -tags "$HUGO_BUILD_TAGS"
./hugo version
ldd hugo || :