Skip to content

Commit

Permalink
Try to give downstream snaps a usable version
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanGriffiths committed May 3, 2024
1 parent 29b3075 commit e46a69a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
mv snap/local/core24~snapcraft.yaml snap/snapcraft.yaml
fi
git config --global --add safe.directory $(pwd)
sed -i 's@version: testing@echo version: '$(git describe)'@' snap/snapcraft.yaml
sed -i 's@version: testing@version: '$(git describe)'@' snap/snapcraft.yaml
- name: Build and publish the snap
uses: canonical/actions/build-snap@release
Expand Down
9 changes: 2 additions & 7 deletions snap/local/core24~snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ description: |
This snap contains the build environment necessary to build Mir display servers.
confinement: strict
adopt-info: mir
version: testing
grade: devel

parts:
mir:
Expand Down Expand Up @@ -97,9 +98,3 @@ parts:
- libxml2
- libxrender1
- libyaml-cpp0.8
override-pull: |
craftctl default
# work around https://github.com/diddlesnaps/snapcraft-multiarch-action/issues/22
git config --global --add safe.directory ${CRAFT_PART_SRC}
craftctl set version=$( git describe | awk -F- '{ gsub(/^v/, "", $1); printf $1; if ($2) { printf "+dev" $2 "-" $3 } }' )
craftctl set grade=$( [[ $( git describe ) =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo stable || echo devel )

0 comments on commit e46a69a

Please sign in to comment.