ci: make build IDs unique per run
Date-only build IDs collided on same-day rebuilds, so release tags already existed and the changelog/release step was skipped. Use the CI run number (timestamp fallback locally).
This commit is contained in:
@@ -47,7 +47,13 @@ CACHE_DIR="${REPO_ROOT}/cache"
|
|||||||
|
|
||||||
[[ -n "${BUILD_MODE}" ]] || { echo "BUILD_MODE not set in ${CONF}" >&2; exit 1; }
|
[[ -n "${BUILD_MODE}" ]] || { echo "BUILD_MODE not set in ${CONF}" >&2; exit 1; }
|
||||||
|
|
||||||
buildid="$(date '+%Y%m%d.0')"
|
# Build IDs must be unique per build (release tags are derived from them), so
|
||||||
|
# include the CI run number when available, otherwise a timestamp.
|
||||||
|
if [[ -n "${GITHUB_RUN_NUMBER:-}" ]]; then
|
||||||
|
buildid="$(date '+%Y%m%d').${GITHUB_RUN_NUMBER}"
|
||||||
|
else
|
||||||
|
buildid="$(date '+%Y%m%d.%H%M%S')"
|
||||||
|
fi
|
||||||
echo "${buildid}" > "${REPO_ROOT}/.buildid"
|
echo "${buildid}" > "${REPO_ROOT}/.buildid"
|
||||||
|
|
||||||
rm -rf "${BUILD_DIR}"
|
rm -rf "${BUILD_DIR}"
|
||||||
|
|||||||
Reference in New Issue
Block a user