Skip to content

Commit

Permalink
Fix problems with snap release (#7237)
Browse files Browse the repository at this point in the history
The change fixes a few problems with the snap builds and release:
1. Snaps weren't built with SNAPCRAFT_BUILD_INFO enabled, so they didn't generate SBOM info. I added the flag to snap builds. Note this isn't a problem for the azure-iot-identity snap because it's built using the snap action in our GitHub workflow, which automatically adds this option.
2. Snaps were published to the edge channel in the release build. This was intentional the first time, but we want to publish directly to the stable channel from now on.

To test, I ran the CI build pipeline and verified that the snaps have an SBOM.

## Azure IoT Edge PR checklist:
  • Loading branch information
damonbarry authored Mar 15, 2024
1 parent ce74e43 commit 2022464
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions builds/misc/packages-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ stages:
- script: |
sudo snap install snapcraft --classic
lxd init --minimal
snapcraft --use-lxd
SNAPCRAFT_BUILD_INFO=1 snapcraft --use-lxd
displayName: Build snap
env:
SNAPCRAFT_BUILD_INFO: 1
Expand Down Expand Up @@ -383,8 +383,7 @@ stages:
sudo snap install snapcraft --classic
for pkg in $(ls $(System.ArtifactsDirectory)/**/*.snap)
do
# TODO: change release channel from 'edge' to 'stable'
snapcraft upload --release=edge "$pkg"
snapcraft upload --release=stable "$pkg"
done
logdir='$(Build.ArtifactStagingDirectory)/logs'
Expand Down
2 changes: 1 addition & 1 deletion builds/misc/templates/build-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ stages:
- script: |
sudo snap install snapcraft --classic
lxd init --minimal
snapcraft --use-lxd
SNAPCRAFT_BUILD_INFO=1 snapcraft --use-lxd
displayName: Build snap
condition: eq(${{ parameters['E2EBuild'] }}, false)
- task: CopyFiles@2
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ parts:
rm -rf $CRAFT_PART_BUILD/target
SC_VERSION="$(cat $CRAFT_PART_SRC/version.txt)"
craftctl set version="$SC_VERSION"
# if version contains substing "dev" set grade to devel, else stable
# if version contains substring "dev" set grade to devel, else stable
if test "${SC_VERSION#*dev}" != "$SC_VERSION" ; then
craftctl set grade=devel
else
Expand Down

0 comments on commit 2022464

Please sign in to comment.