2023-07-20 14:25:13 -04:00
|
|
|
#!/usr/bin/env bash
|
2022-08-16 07:51:45 -04:00
|
|
|
|
|
|
|
if [[ -z "${BUILD_SOURCEVERSION}" ]]; then
|
|
|
|
|
2023-07-21 10:45:07 -04:00
|
|
|
if type -t "sha1sum" &> /dev/null; then
|
2023-07-20 14:25:13 -04:00
|
|
|
BUILD_SOURCEVERSION=$( echo "${RELEASE_VERSION/-*/}" | sha1sum | cut -d' ' -f1 )
|
2022-08-21 13:15:37 -04:00
|
|
|
else
|
|
|
|
npm install -g checksum
|
|
|
|
|
2023-07-20 14:25:13 -04:00
|
|
|
BUILD_SOURCEVERSION=$( echo "${RELEASE_VERSION/-*/}" | checksum )
|
2022-08-21 13:15:37 -04:00
|
|
|
fi
|
2022-08-16 07:51:45 -04:00
|
|
|
|
2022-10-02 04:39:39 -04:00
|
|
|
echo "BUILD_SOURCEVERSION=\"${BUILD_SOURCEVERSION}\""
|
2022-08-16 07:51:45 -04:00
|
|
|
|
|
|
|
# for GH actions
|
2022-10-16 17:55:34 -04:00
|
|
|
if [[ "${GITHUB_ENV}" ]]; then
|
|
|
|
echo "BUILD_SOURCEVERSION=${BUILD_SOURCEVERSION}" >> "${GITHUB_ENV}"
|
2022-08-16 07:51:45 -04:00
|
|
|
fi
|
|
|
|
fi
|
2023-07-20 14:25:13 -04:00
|
|
|
|
|
|
|
export BUILD_SOURCEVERSION
|