From d65ccfe6bac01e8ebdd5b428d7f3cac3dc520e1e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 9 Jan 2026 01:18:20 +0000 Subject: [PATCH] Add date normalization script for release pipeline Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com> --- scripts/release/update_dates.sh | 67 +++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 scripts/release/update_dates.sh diff --git a/scripts/release/update_dates.sh b/scripts/release/update_dates.sh new file mode 100755 index 0000000..3e485e4 --- /dev/null +++ b/scripts/release/update_dates.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +# Copyright (C) 2025 Moko Consulting +# +# This file is part of a Moko Consulting project. +# +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see https://www.gnu.org/licenses/ . +# +# FILE INFORMATION +# DEFGROUP: Release +# INGROUP: Moko-Cassiopeia +# PATH: scripts/release/update_dates.sh +# VERSION: 03.05.00 +# BRIEF: Normalize dates in release files + +set -euo pipefail + +# Accept date and version as arguments +TODAY="${1:-$(date +%Y-%m-%d)}" +VERSION="${2:-unknown}" + +echo "Date normalization script running..." +echo "TODAY: ${TODAY}" +echo "VERSION: ${VERSION}" + +# Update CHANGELOG.md - replace the date on the version heading line +if [ -f "CHANGELOG.md" ]; then + # Match lines like "## [03.05.00] 2026-01-04" and update the date + if grep -q "^## \[${VERSION}\] " CHANGELOG.md; then + sed -i "s/^## \[${VERSION}\] [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/## [${VERSION}] ${TODAY}/" CHANGELOG.md + echo "✓ Updated CHANGELOG.md version [${VERSION}] date to ${TODAY}" + else + echo "⚠ Warning: CHANGELOG.md does not contain version [${VERSION}] heading" + fi +else + echo "⚠ Warning: CHANGELOG.md not found" +fi + +# Update src/templates/templateDetails.xml - replace the tag +if [ -f "src/templates/templateDetails.xml" ]; then + sed -i "s|[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}|${TODAY}|" src/templates/templateDetails.xml + echo "✓ Updated src/templates/templateDetails.xml creationDate to ${TODAY}" +else + echo "⚠ Warning: src/templates/templateDetails.xml not found" +fi + +# Update updates.xml - replace the tag +if [ -f "updates.xml" ]; then + sed -i "s|[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}|${TODAY}|" updates.xml + echo "✓ Updated updates.xml creationDate to ${TODAY}" +else + echo "⚠ Warning: updates.xml not found" +fi + +echo "Date normalization complete."