From 1334631382760a86ebc39b2515a1f1117b9a757c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 23 Dec 2024 16:18:24 +0100 Subject: [PATCH] Always use system date for changelogs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- meta/releasing.md | 5 +++-- scripts/generate-changelog.sh | 18 +++--------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/meta/releasing.md b/meta/releasing.md index 31c8386d..3fcc2028 100644 --- a/meta/releasing.md +++ b/meta/releasing.md @@ -79,8 +79,9 @@ release. 3. Commit the changes. 4. Generate the changelog. 1. Activate your python virtual environment. - 2. Run `./scripts/generate-changelog.sh v1.2 2021-10-01` (using the correct - version number and the `YYYY-MM-DD` format for the release date). + 2. Run `./scripts/generate-changelog.sh v1.2` (using the correct version number). + The script while use the current date. If that date is wrong, correct it by using + the same `YYYY-MM-DD` date format. 3. Commit the result. 5. Tag the branch with the spec release with a format of `v1.2` (if releasing Matrix 1.2). 6. Push the release branch and the tag. diff --git a/scripts/generate-changelog.sh b/scripts/generate-changelog.sh index f95c3e67..678af60f 100755 --- a/scripts/generate-changelog.sh +++ b/scripts/generate-changelog.sh @@ -1,12 +1,11 @@ # /bin/bash -# Usage: ./scripts/generate-changelog.sh v1.2 2021-04-01 -# or: ./scripts/generate-changelog.sh vUNSTABLE +# Usage: ./scripts/generate-changelog.sh v1.2 for changelogs of stable releases +# or: ./scripts/generate-changelog.sh vUNSTABLE for the unstable changelog. set -e VERSION="$1" -DATE="$2" if [ -z "$VERSION" ]; then echo "ERROR: The version of the changelog must be provided" @@ -17,21 +16,10 @@ if [ "$VERSION" = "vUNSTABLE" ]; then TITLE="Changes since last release" LINKTITLE="Unstable" FILENAME="unstable.md" - DATE=$(date -Iseconds) else TITLE="$VERSION Changelog" LINKTITLE="$VERSION" FILENAME="$VERSION.md" - - if [ -z "$DATE" ]; then - echo "ERROR: The date of the release must be provided for stable releases" - exit 1 - fi - - if [[ ! "$DATE" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then - echo "ERROR: The date does not have the format YYYY-MM-DD" - exit 1 - fi fi cd `dirname $0`/../changelogs @@ -55,7 +43,7 @@ layout: changelog outputs: - html - checklist -date: $DATE +date: $(date -Idate) --- EOF # Remove trailing whitespace (such as our intentionally blank RST headings)