fix(build): sync VERSION file with semantic-release tags and add build time
- Update generate_build_metadata.sh to sync VERSION from latest git tag - Change BUILD_DATE format from date-only to ISO 8601 with time (YYYY-MM-DDTHH:MM:SSZ) - Fix VERSION file from 0.5.0 to 0.9.1 (matching latest git tag v0.9.1) - Change version fallback from hardcoded '0.5.0-dev' to 'unknown' in config.py - Update release.yml to commit all build metadata files (not just VERSION) - Update BuildMetadata.md documentation to reflect automated versioning - Add tests for build_date with time format and version unknown fallback Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -27,8 +27,8 @@ cd "${PROJECT_ROOT}"
|
||||
|
||||
echo "Generating build metadata..."
|
||||
|
||||
# Generate BUILD_DATE in ISO 8601 format (UTC)
|
||||
BUILD_DATE=$(date -u '+%Y-%m-%d')
|
||||
# Generate BUILD_DATE in ISO 8601 format with time (UTC)
|
||||
BUILD_DATE=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
|
||||
echo "${BUILD_DATE}" > BUILD_DATE
|
||||
echo "✓ BUILD_DATE: ${BUILD_DATE}"
|
||||
|
||||
@@ -58,12 +58,28 @@ fi
|
||||
# Read VERSION file
|
||||
if [ -f "VERSION" ]; then
|
||||
VERSION=$(cat VERSION | tr -d '\n')
|
||||
echo "✓ VERSION: ${VERSION}"
|
||||
echo "✓ VERSION (from file): ${VERSION}"
|
||||
else
|
||||
echo "⚠ Warning: VERSION file not found"
|
||||
VERSION="unknown"
|
||||
fi
|
||||
|
||||
# Try to derive version from the latest git tag (semantic-release creates vX.Y.Z tags)
|
||||
if git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
||||
if [ -n "${LATEST_TAG}" ]; then
|
||||
# Strip the 'v' prefix from the tag (e.g., v0.9.1 -> 0.9.1)
|
||||
TAG_VERSION="${LATEST_TAG#v}"
|
||||
if [ "${TAG_VERSION}" != "${VERSION}" ]; then
|
||||
echo "⚠ VERSION file (${VERSION}) is out of sync with latest tag (${TAG_VERSION})"
|
||||
echo " Updating VERSION file to ${TAG_VERSION}"
|
||||
echo "${TAG_VERSION}" > VERSION
|
||||
VERSION="${TAG_VERSION}"
|
||||
echo "✓ VERSION (updated from tag): ${VERSION}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Generate RUNTIME_INFO with combined metadata
|
||||
cat > RUNTIME_INFO << EOF
|
||||
DocuElevate Build Information
|
||||
|
||||
Reference in New Issue
Block a user