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