snap: fix grade determination

Determine grade based on whether we actually managed to check out the
buildnumber.

This assumes that the tree is clean for building a stable snap (one that
can be published to candidate and stable channels).

Signed-off-by: Michał Sawicz <michal@sawicz.net>
This commit is contained in:
Michał Sawicz 2024-03-01 08:08:21 +01:00 committed by Dirk Hohndel
parent cb3e21c443
commit 96470227d5

View file

@ -159,8 +159,8 @@ parts:
- qttools5-dev
override-pull: |
craftctl default
if [ ! -f latest-subsurface-buildnumber ]; then
git fetch --depth=1 https://github.com/subsurface/nightly-builds.git branch-for-$( git rev-parse HEAD )
if [ ! -f latest-subsurface-buildnumber ] \
&& git fetch --depth=1 https://github.com/subsurface/nightly-builds.git branch-for-$( git rev-parse HEAD ); then
git checkout FETCH_HEAD latest-subsurface-buildnumber
# We succeeded getting the release version, allow publishing above `beta`
craftctl set grade=stable