From 96470227d5c5527e5d06fc2d38b4463ea7222d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sawicz?= Date: Fri, 1 Mar 2024 08:08:21 +0100 Subject: [PATCH] snap: fix grade determination MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- snap/snapcraft.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 7970508d4..3791f55b5 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -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