File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed
scripts/build-os-packages Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -219,8 +219,7 @@ jobs:
219219 if [ "${{ inputs.release_mode }}" = "true" ] ; then
220220 args="--sign"
221221 else
222- #args="--git-version"
223- args=""
222+ args="--suffix +${GITHUB_SHA:0:8}"
224223 fi
225224 pipenv run bash -c scripts/build-os-packages/build-os-packages $args
226225
Original file line number Diff line number Diff line change @@ -15,10 +15,7 @@ REQUIREMENTS="pyinstaller"
1515# Whether we want a signed binary or not
1616DO_SIGN=0
1717
18- # Where to find the version:
19- # - 0: read it from ggshield/__init__.py
20- # - 1: generate it using `git describe`
21- USE_GIT_VERSION=0
18+ VERSION_SUFFIX=" "
2219
2320# Colors
2421C_RED=" \e[31;1m"
@@ -62,7 +59,7 @@ Default steps are: $DEFAULT_STEPS
6259Options:
6360 -h, --help Display this usage message and exit.
6461 --sign Sign the binary, on supported OSes.
65- --git-version Append "+COMMIT_SHA " to the version number.
62+ --suffix SUFFIX Append "SUFFIX " to the version number.
6663
6764For more details, see doc/dev/os-packages.md.
6865EOF
7269
7370read_version () {
7471 VERSION=$( grep -o " [0-9]*\.[0-9]*\.[0-9]*" " $ROOT_DIR /ggshield/__init__.py" )
75- if [ " $USE_GIT_VERSION " -eq 1 ] ; then
76- local commit_sha
77- commit_sha=$( git rev-parse --short HEAD)
78- VERSION=" $VERSION +$commit_sha "
72+ if [ -n " $VERSION_SUFFIX " ] ; then
73+ VERSION=" ${VERSION}${VERSION_SUFFIX} "
7974 fi
8075 info " VERSION=$VERSION "
8176}
@@ -343,8 +338,9 @@ while [ $# -gt 0 ] ; do
343338 --sign)
344339 DO_SIGN=1
345340 ;;
346- --git-version)
347- USE_GIT_VERSION=1
341+ --suffix)
342+ VERSION_SUFFIX=" $2 "
343+ shift
348344 ;;
349345 -* )
350346 usage " Unknown option '$1 '"
You can’t perform that action at this time.
0 commit comments