From 604f83fc27c9df3b70cd783e59e440fadfe0ef3c Mon Sep 17 00:00:00 2001 From: Damon Barry Date: Thu, 14 Mar 2024 16:45:10 -0700 Subject: [PATCH] Set snap grade according to version (#597) Cherry-pick 417fed0e3ff1286f6232a4a006a7cac822585f4c --- snap/snapcraft.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 67e5025d..23d44a68 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -9,8 +9,8 @@ description: | license: MIT -grade: devel # must be 'stable' to release into candidate/stable channels confinement: strict +adopt-info: iot-identity-services parts: rust-toolchain: @@ -61,6 +61,13 @@ parts: - libtss2-sys1 - libtss2-tctildr0 override-build: | + # if version contains substring "dev" set grade to devel, else stable + SC_VERSION="$(craftctl get version)" + if test "${SC_VERSION#*dev}" != "$SC_VERSION" ; then + craftctl set grade=devel + else + craftctl set grade=stable + fi contrib/third-party-notices.sh > THIRD-PARTY-NOTICES make install-deb \ ARCH=$CRAFT_ARCH_BUILD_FOR \