Skip to content

Commit ac714b0

Browse files
committed
Remote builds don't play nice with git describe
1 parent 9906dcf commit ac714b0

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

.github/workflows/snap.yml

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747
if [ "${{ matrix.base }}" == "24" ]; then
4848
mv snap/local/core24~snapcraft.yaml snap/snapcraft.yaml
4949
fi
50+
git config --global --add safe.directory $(pwd)
51+
sed -i 's@version: testing@version: '$(git describe)'@' snap/snapcraft.yaml
5052
5153
- name: Build and publish the snap
5254
uses: canonical/actions/build-snap@release

snap/local/core24~snapcraft.yaml

+2-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ description: |
99
This snap contains the build environment necessary to build Mir display servers.
1010
1111
confinement: strict
12-
adopt-info: mir
12+
version: testing
13+
grade: devel
1314

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

snap/snapcraft.yaml

+2-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ description: |
88
This snap contains the build environment necessary to build Mir display servers.
99
1010
confinement: strict
11-
adopt-info: mir
11+
version: testing
12+
grade: devel
1213

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

0 commit comments

Comments
 (0)