Skip to content

Commit

Permalink
Set snap grade according to version (#596)
Browse files Browse the repository at this point in the history
Snaps are currently built with grade=devel, which means they can't be promoted to the stable channel. We want dev builds (e.g., builds from main) to keep grade=devel so they can't accidentally be promoted, but we want release builds to be grade=stable. This change adds the logic to do that, and is patterned after similar logic in the azure-iot-edge snap.
  • Loading branch information
damonbarry authored Mar 13, 2024
1 parent 2af0c81 commit 417fed0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ description: |
license: MIT

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: strict

parts:
Expand Down Expand Up @@ -61,6 +60,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 \
Expand Down

0 comments on commit 417fed0

Please sign in to comment.