File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 with :
1616 fetch-depth : 0
1717
18+ - name : Write VERSION
19+ run : echo "${GITHUB_REF_NAME}" > VERSION
20+
1821 - name : Build snap
1922 id : build
2023 uses : snapcore/action-build@v1
Original file line number Diff line number Diff line change @@ -29,10 +29,10 @@ parts:
2929 - requirements.txt
3030 override-pull : |
3131 craftctl default
32- if [ -n "${GITHUB_REF_NAME:-} " ]; then
33- craftctl set version="${GITHUB_REF_NAME} "
34- elif command -v git >/dev/null 2>&1 ; then
35- craftctl set version="$(git describe --tags --long --always 2>/dev/null || git rev-parse --short HEAD )"
32+ if [ -f "${CRAFT_PROJECT_DIR:-.}/VERSION " ]; then
33+ craftctl set version="$(cat "${CRAFT_PROJECT_DIR:-.}/VERSION") "
34+ elif [ -f "${CRAFT_PART_SRC}/VERSION" ] ; then
35+ craftctl set version="$(cat "${CRAFT_PART_SRC}/VERSION" )"
3636 else
3737 craftctl set version="0+unknown"
3838 fi
You can’t perform that action at this time.
0 commit comments