Version number fix
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -23,7 +23,7 @@
|
|||||||
# INGROUP: GitHub.Actions.ContinuousIntegration
|
# INGROUP: GitHub.Actions.ContinuousIntegration
|
||||||
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
||||||
# PATH: /.github/workflows/ci.yml
|
# PATH: /.github/workflows/ci.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 03.05.00
|
||||||
# BRIEF: Continuous integration governance workflow for standards enforcement.
|
# BRIEF: Continuous integration governance workflow for standards enforcement.
|
||||||
# NOTE: Runs on every push. Auto-normalizes YAML tabs to two spaces before validation.
|
# NOTE: Runs on every push. Auto-normalizes YAML tabs to two spaces before validation.
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|||||||
2
.github/workflows/release_pipeline.yml
vendored
2
.github/workflows/release_pipeline.yml
vendored
@@ -23,7 +23,7 @@
|
|||||||
# INGROUP: MokoStandards.Release
|
# INGROUP: MokoStandards.Release
|
||||||
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
||||||
# PATH: /.github/workflows/release_pipeline.yml
|
# PATH: /.github/workflows/release_pipeline.yml
|
||||||
# VERSION: 01.02.00
|
# VERSION: 03.05.00
|
||||||
# BRIEF: Enterprise release pipeline enforcing dev to rc to version to main. Creates prerelease when rc is created. Creates full release when version is created and promotes to main while retaining the version branch.
|
# BRIEF: Enterprise release pipeline enforcing dev to rc to version to main. Creates prerelease when rc is created. Creates full release when version is created and promotes to main while retaining the version branch.
|
||||||
# NOTE: Controls: strict branch gating, mandatory source branch deletion after promotion, key-only SFTP with verbose logs, ZIP-only distribution with overwrite, no checksum generation.
|
# NOTE: Controls: strict branch gating, mandatory source branch deletion after promotion, key-only SFTP with verbose logs, ZIP-only distribution with overwrite, no checksum generation.
|
||||||
#
|
#
|
||||||
|
|||||||
2
.github/workflows/version_branch.yml
vendored
2
.github/workflows/version_branch.yml
vendored
@@ -20,7 +20,7 @@
|
|||||||
# INGROUP: GitHub.Versioning.Branching
|
# INGROUP: GitHub.Versioning.Branching
|
||||||
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
||||||
# PATH: /.github/workflows/version_branch.yml
|
# PATH: /.github/workflows/version_branch.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 03.05.00
|
||||||
# BRIEF: Create a dev/<version> branch and align versions across governed files
|
# BRIEF: Create a dev/<version> branch and align versions across governed files
|
||||||
# NOTE: Enterprise gates: required artifacts, namespace defense, deterministic reporting, control character guard
|
# NOTE: Enterprise gates: required artifacts, namespace defense, deterministic reporting, control character guard
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
# INGROUP: GitHub.Actions.Utilities
|
# INGROUP: GitHub.Actions.Utilities
|
||||||
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
||||||
# PATH: /scripts/fix_tabs.sh
|
# PATH: /scripts/fix_tabs.sh
|
||||||
# VERSION: 01.00.00
|
# VERSION: 03.05.00
|
||||||
# BRIEF: Utility script to replace tab characters with two spaces in YAML files.
|
# BRIEF: Utility script to replace tab characters with two spaces in YAML files.
|
||||||
# NOTE: Intended for local developer use. Not executed automatically in CI.
|
# NOTE: Intended for local developer use. Not executed automatically in CI.
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
# INGROUP: Date.Normalization
|
# INGROUP: Date.Normalization
|
||||||
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
||||||
# PATH: /scripts/update_dates.sh
|
# PATH: /scripts/update_dates.sh
|
||||||
# VERSION: 01.00.01
|
# VERSION: 03.05.00
|
||||||
# BRIEF: Normalize release dates across manifests and CHANGELOG using a single authoritative UTC date.
|
# BRIEF: Normalize release dates across manifests and CHANGELOG using a single authoritative UTC date.
|
||||||
# NOTE: Repo-controlled script only. CI-fatal on malformed inputs. Outputs a JSON report to stdout.
|
# NOTE: Repo-controlled script only. CI-fatal on malformed inputs. Outputs a JSON report to stdout.
|
||||||
|
|
||||||
@@ -34,50 +34,50 @@ TODAY_UTC="${1:-}"
|
|||||||
VERSION="${2:-}"
|
VERSION="${2:-}"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "ERROR: Usage: update_dates.sh <YYYY-MM-DD> <VERSION>" >&2
|
echo "ERROR: Usage: update_dates.sh <YYYY-MM-DD> <VERSION>" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "${TODAY_UTC}" ] || [ -z "${VERSION}" ]; then
|
if [ -z "${TODAY_UTC}" ] || [ -z "${VERSION}" ]; then
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate date format strictly
|
# Validate date format strictly
|
||||||
if ! echo "${TODAY_UTC}" | grep -Eq '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'; then
|
if ! echo "${TODAY_UTC}" | grep -Eq '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'; then
|
||||||
echo "ERROR: Invalid date format. Expected YYYY-MM-DD, got '${TODAY_UTC}'" >&2
|
echo "ERROR: Invalid date format. Expected YYYY-MM-DD, got '${TODAY_UTC}'" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate version format strictly
|
# Validate version format strictly
|
||||||
if ! echo "${VERSION}" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
|
if ! echo "${VERSION}" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
|
||||||
echo "ERROR: Invalid version format. Expected X.Y.Z, got '${VERSION}'" >&2
|
echo "ERROR: Invalid version format. Expected X.Y.Z, got '${VERSION}'" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cross-platform sed in-place helper (GNU and BSD)
|
# Cross-platform sed in-place helper (GNU and BSD)
|
||||||
# - Ubuntu runners use GNU sed, but this keeps local execution deterministic.
|
# - Ubuntu runners use GNU sed, but this keeps local execution deterministic.
|
||||||
sed_inplace() {
|
sed_inplace() {
|
||||||
local expr="$1"
|
local expr="$1"
|
||||||
local file="$2"
|
local file="$2"
|
||||||
|
|
||||||
if sed --version >/dev/null 2>&1; then
|
if sed --version >/dev/null 2>&1; then
|
||||||
sed -i -E "${expr}" "${file}"
|
sed -i -E "${expr}" "${file}"
|
||||||
else
|
else
|
||||||
sed -i '' -E "${expr}" "${file}"
|
sed -i '' -E "${expr}" "${file}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Normalizing dates to ${TODAY_UTC} for version ${VERSION}"
|
echo "Normalizing dates to ${TODAY_UTC} for version ${VERSION}"
|
||||||
|
|
||||||
# Update CHANGELOG.md heading date
|
# Update CHANGELOG.md heading date
|
||||||
if [ ! -f CHANGELOG.md ]; then
|
if [ ! -f CHANGELOG.md ]; then
|
||||||
echo "ERROR: CHANGELOG.md not found" >&2
|
echo "ERROR: CHANGELOG.md not found" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -Eq "^## \[${VERSION}\]" CHANGELOG.md; then
|
if ! grep -Eq "^## \[${VERSION}\]" CHANGELOG.md; then
|
||||||
echo "ERROR: CHANGELOG.md does not contain heading for version [${VERSION}]" >&2
|
echo "ERROR: CHANGELOG.md does not contain heading for version [${VERSION}]" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use a delimiter that will not collide with the pattern (the heading starts with "##")
|
# Use a delimiter that will not collide with the pattern (the heading starts with "##")
|
||||||
@@ -88,44 +88,44 @@ XML_SCANNED=0
|
|||||||
XML_TOUCHED=0
|
XML_TOUCHED=0
|
||||||
|
|
||||||
while IFS= read -r -d '' FILE; do
|
while IFS= read -r -d '' FILE; do
|
||||||
XML_SCANNED=$((XML_SCANNED + 1))
|
XML_SCANNED=$((XML_SCANNED + 1))
|
||||||
|
|
||||||
BEFORE_HASH=""
|
BEFORE_HASH=""
|
||||||
AFTER_HASH=""
|
AFTER_HASH=""
|
||||||
|
|
||||||
# Best-effort content hash for change detection without external deps.
|
# Best-effort content hash for change detection without external deps.
|
||||||
if command -v sha256sum >/dev/null 2>&1; then
|
if command -v sha256sum >/dev/null 2>&1; then
|
||||||
BEFORE_HASH="$(sha256sum "${FILE}" | awk '{print $1}')"
|
BEFORE_HASH="$(sha256sum "${FILE}" | awk '{print $1}')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use # delimiter because XML does not include # in these tags.
|
# Use # delimiter because XML does not include # in these tags.
|
||||||
sed -i "s#<creationDate>[^<]*</creationDate>#<creationDate>${TODAY_UTC}</creationDate>#g" "${FILE}" || true
|
sed -i "s#<creationDate>[^<]*</creationDate>#<creationDate>${TODAY_UTC}</creationDate>#g" "${FILE}" || true
|
||||||
sed -i "s#<date>[^<]*</date>#<date>${TODAY_UTC}</date>#g" "${FILE}" || true
|
sed -i "s#<date>[^<]*</date>#<date>${TODAY_UTC}</date>#g" "${FILE}" || true
|
||||||
sed -i "s#<buildDate>[^<]*</buildDate>#<buildDate>${TODAY_UTC}</buildDate>#g" "${FILE}" || true
|
sed -i "s#<buildDate>[^<]*</buildDate>#<buildDate>${TODAY_UTC}</buildDate>#g" "${FILE}" || true
|
||||||
|
|
||||||
if [ -n "${BEFORE_HASH}" ]; then
|
if [ -n "${BEFORE_HASH}" ]; then
|
||||||
AFTER_HASH="$(sha256sum "${FILE}" | awk '{print $1}')"
|
AFTER_HASH="$(sha256sum "${FILE}" | awk '{print $1}')"
|
||||||
if [ "${BEFORE_HASH}" != "${AFTER_HASH}" ]; then
|
if [ "${BEFORE_HASH}" != "${AFTER_HASH}" ]; then
|
||||||
XML_TOUCHED=$((XML_TOUCHED + 1))
|
XML_TOUCHED=$((XML_TOUCHED + 1))
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done < <(
|
done < <(
|
||||||
find . -type f -name "*.xml" \
|
find . -type f -name "*.xml" \
|
||||||
-not -path "./.git/*" \
|
-not -path "./.git/*" \
|
||||||
-not -path "./.github/*" \
|
-not -path "./.github/*" \
|
||||||
-not -path "./dist/*" \
|
-not -path "./dist/*" \
|
||||||
-not -path "./node_modules/*" \
|
-not -path "./node_modules/*" \
|
||||||
-print0
|
-print0
|
||||||
)
|
)
|
||||||
|
|
||||||
# JSON report to stdout (workflow can capture or include in summary)
|
# JSON report to stdout (workflow can capture or include in summary)
|
||||||
printf '{"today_utc":"%s","version":"%s","changelog":"%s","xml_scanned":%s,"xml_touched":%s}
|
printf '{"today_utc":"%s","version":"%s","changelog":"%s","xml_scanned":%s,"xml_touched":%s}
|
||||||
' \
|
' \
|
||||||
"${TODAY_UTC}" \
|
"${TODAY_UTC}" \
|
||||||
"${VERSION}" \
|
"${VERSION}" \
|
||||||
"CHANGELOG.md" \
|
"CHANGELOG.md" \
|
||||||
"${XML_SCANNED}" \
|
"${XML_SCANNED}" \
|
||||||
"${XML_TOUCHED}"
|
"${XML_TOUCHED}"
|
||||||
|
|
||||||
echo "Date normalization complete."
|
echo "Date normalization complete."
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
# INGROUP: GitHub.Actions.CI
|
# INGROUP: GitHub.Actions.CI
|
||||||
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
||||||
# PATH: /scripts/validate_tabs.sh
|
# PATH: /scripts/validate_tabs.sh
|
||||||
# VERSION: 01.00.00
|
# VERSION: 03.05.00
|
||||||
# BRIEF: CI validator that blocks tab characters in YAML files and enforces two-space indentation policy.
|
# BRIEF: CI validator that blocks tab characters in YAML files and enforces two-space indentation policy.
|
||||||
# NOTE: YAML is indentation sensitive; tabs are noncompliant. This validator fails the job when any tab is detected.
|
# NOTE: YAML is indentation sensitive; tabs are noncompliant. This validator fails the job when any tab is detected.
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user