Always use system date for changelogs

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2024-12-23 16:18:24 +01:00
parent 2fe211c978
commit 1334631382
No known key found for this signature in database
GPG key ID: 0C971D9DBC9D678D
2 changed files with 6 additions and 17 deletions

View file

@ -79,8 +79,9 @@ release.
3. Commit the changes. 3. Commit the changes.
4. Generate the changelog. 4. Generate the changelog.
1. Activate your python virtual environment. 1. Activate your python virtual environment.
2. Run `./scripts/generate-changelog.sh v1.2 2021-10-01` (using the correct 2. Run `./scripts/generate-changelog.sh v1.2` (using the correct version number).
version number and the `YYYY-MM-DD` format for the release date). 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. 3. Commit the result.
5. Tag the branch with the spec release with a format of `v1.2` (if releasing Matrix 1.2). 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. 6. Push the release branch and the tag.

View file

@ -1,12 +1,11 @@
# /bin/bash # /bin/bash
# Usage: ./scripts/generate-changelog.sh v1.2 2021-04-01 # Usage: ./scripts/generate-changelog.sh v1.2 for changelogs of stable releases
# or: ./scripts/generate-changelog.sh vUNSTABLE # or: ./scripts/generate-changelog.sh vUNSTABLE for the unstable changelog.
set -e set -e
VERSION="$1" VERSION="$1"
DATE="$2"
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
echo "ERROR: The version of the changelog must be provided" echo "ERROR: The version of the changelog must be provided"
@ -17,21 +16,10 @@ if [ "$VERSION" = "vUNSTABLE" ]; then
TITLE="Changes since last release" TITLE="Changes since last release"
LINKTITLE="Unstable" LINKTITLE="Unstable"
FILENAME="unstable.md" FILENAME="unstable.md"
DATE=$(date -Iseconds)
else else
TITLE="$VERSION Changelog" TITLE="$VERSION Changelog"
LINKTITLE="$VERSION" LINKTITLE="$VERSION"
FILENAME="$VERSION.md" 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 fi
cd `dirname $0`/../changelogs cd `dirname $0`/../changelogs
@ -55,7 +43,7 @@ layout: changelog
outputs: outputs:
- html - html
- checklist - checklist
date: $DATE date: $(date -Idate)
--- ---
EOF EOF
# Remove trailing whitespace (such as our intentionally blank RST headings) # Remove trailing whitespace (such as our intentionally blank RST headings)