]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
snap: Use "snapcraftctl set-version"
authorAnthony Fok <foka@debian.org>
Tue, 30 Aug 2022 05:14:22 +0000 (23:14 -0600)
committerAnthony Fok <foka@debian.org>
Tue, 30 Aug 2022 05:14:22 +0000 (23:14 -0600)
This allows the use of "git describe --tags" to recognize lightweight
version tags, and the removal of initial "v" in the hugo snap version.

See #10225

snap/snapcraft.yaml

index 8bf0126c51f2de6d7ca345b5f87fbbe9ae1726a8..64083bcc46316f09e60dd95644183fa49c1a2135 100644 (file)
@@ -1,5 +1,4 @@
 name: hugo
-version: git
 issues: https://github.com/gohugoio/hugo/issues
 source-code: https://github.com/gohugoio/hugo.git
 website: https://gohugo.io/
@@ -12,6 +11,7 @@ license: "Apache-2.0"
 base: core20
 confinement: strict
 grade: devel # "devel" or "stable"
+adopt-info: hugo
 
 package-repositories:
   - type: apt
@@ -77,6 +77,9 @@ parts:
     after:
       - git
       - go
+    override-pull: |
+      snapcraftctl pull
+      snapcraftctl set-version "$(git describe --tags --always --match 'v[0-9]*' | sed 's/^v//; s/-/+git/; s/-g/./')"
     override-build: |
       echo "\nStarting override-build:"
       set -ex