build/linux: Use custom name: for nightly Snap builds

This avois overriding the local stable installation.
This commit is contained in:
Bruno Lopes 2025-10-11 10:04:49 -03:00
parent cde74f27db
commit 51e9135c58
No known key found for this signature in database
3 changed files with 10 additions and 9 deletions

View file

@ -28,8 +28,8 @@ printf "\e[0Ksection_start:`date +%s`:snap_info\r\e[0KGetting snap global info\n
cp build/linux/snap/snapcraft.yaml .
## Set proper Snap name and update track
NAME=$(awk '/^name:/ { print $2 }' snapcraft.yaml)
TRACK=$(awk -F. '/-Dbuild-id=/ { print $NF }' snapcraft.yaml)
printf "(INFO): Name: $NAME (track: $TRACK)\n"
TRACK=$(awk -F. '/-Dbuild-id=/ { print $NF }' snapcraft.yaml); if [ "$NAME" = 'gimp' ]; then $track_text=" (track: $TRACK)"; fi
printf "(INFO): Name: ${NAME}${track_text}\n"
## Autodetects what archs will be packaged
supported_archs=$(find . -maxdepth 1 -iname "*.snap")
@ -60,7 +60,7 @@ printf "\e[0Ksection_end:`date +%s`:${SNAP}_making\r\e[0K\n"
# Generate shasums for .snap
if [ "$CI_COMMIT_TAG" != "$(git describe --all | sed 's|tags/||')" ]; then
if [ "$NAME" != 'gimp' ]; then
printf "\e[0Ksection_start:`date +%s`:${SNAP}_trust[collapsed=true]\r\e[0KChecksumming ${SNAP}\n"
printf "(INFO): ${SNAP} SHA-256: $(sha256sum ${SNAP} | cut -d ' ' -f 1)\n"
printf "(INFO): ${SNAP} SHA-512: $(sha512sum ${SNAP} | cut -d ' ' -f 1)\n"
@ -77,7 +77,7 @@ fi
# Publish GIMP snap on Snap Store
# (the credentials are stored on SNAPCRAFT_STORE_CREDENTIALS protected var)
if [ "$CI_COMMIT_TAG" = "$(git describe --all | sed 's|tags/||')" ]; then
if [ "$CI_COMMIT_TAG" = "$(git describe --all | sed 's|tags/||')" ] && [ "$NAME" = 'gimp' ] && { [ "$TRACK" = 'preview' ] || [ "$TRACK" = 'latest' ]; }; then
printf "\e[0Ksection_start:`date +%s`:${SNAP}_submission[collapsed=true]\r\e[0KPublishing snap to Snap Store\n"
snapcraft upload --release=$TRACK/stable $output_dir/${SNAP}
printf "\e[0Ksection_end:`date +%s`:${SNAP}_submission\r\e[0K\n"

View file

@ -39,8 +39,9 @@ ls "$(echo /snap/gnome*-sdk/current/usr/lib/$(gcc -print-multiarch)/pkgconfig)"
Unlike the flatpak, we do not need to manually set babl, gegl or GIMP tags, just:
* For a **nightly** build, set "devel" on "grade" and
use "experimental" on build-id at gimp part "meson-parameters".
* For a **nightly** build, set "devel" on "grade",
use "experimental" on build-id at gimp part "meson-parameters" and
add "name: gimp-experimental".
* For a new **development** series, set "stable" on "grade" and
use "preview" on build-id at gimp part "meson-parameters".

View file

@ -1,4 +1,4 @@
name: gimp
name: gimp-experimental
adopt-info: gimp
grade: devel
base: core24
@ -91,7 +91,7 @@ parts:
source: https://gitlab.gnome.org/GNOME/babl.git
source-depth: 1
override-pull: |
if [ "$SNAPCRAFT_PROJECT_GRADE" = 'devel' ]; then
if [ "$SNAPCRAFT_PROJECT_GRADE" != 'stable' ] && [ "$SNAPCRAFT_PROJECT_NAME" != 'gimp' ]; then
craftctl default
else
repo="https://gitlab.gnome.org/GNOME/$CRAFT_PART_NAME.git"
@ -112,7 +112,7 @@ parts:
source: https://gitlab.gnome.org/GNOME/gegl.git
source-depth: 1
override-pull: |
if [ "$SNAPCRAFT_PROJECT_GRADE" = 'devel' ]; then
if [ "$SNAPCRAFT_PROJECT_GRADE" != 'stable' ] && [ "$SNAPCRAFT_PROJECT_NAME" != 'gimp' ]; then
craftctl default
else
repo="https://gitlab.gnome.org/GNOME/$CRAFT_PART_NAME.git"