use improved versioning (#6691)

This commit is contained in:
Omer Akram 2021-06-12 03:27:59 +05:00 committed by GitHub
parent 337eb8b8f7
commit a9fb540884
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -31,8 +31,14 @@ parts:
snapcraftctl pull
tag=$(git describe --tags --abbrev=0)
count=$(git rev-list $tag.. --count)
hash=$(git rev-parse --short HEAD)
snapcraftctl set-version $tag+git$count.$hash
if [ "$count" = 0 ];
then
version=$tag
else
hash=$(git rev-parse --short HEAD)
version=$tag+git$count.$hash
fi
snapcraftctl set-version $version
apps: