From 5edd3c14810c1aa93be5adde471071b97ef108b4 Mon Sep 17 00:00:00 2001 From: Tasos Sahanidis Date: Tue, 2 Jun 2026 14:41:33 +0300 Subject: [PATCH] scripts: Add update_changelog.sh It is of unknown quality and whether it actually works or not --- scripts/update_changelog.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/update_changelog.sh diff --git a/scripts/update_changelog.sh b/scripts/update_changelog.sh new file mode 100755 index 00000000..5604fba4 --- /dev/null +++ b/scripts/update_changelog.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +if [[ $# -ne 3 ]]; then + echo "Usage $0 0 5 0" + exit 2 +fi + +LOG=$(cat CHANGELOG.md | tail -n +2) +DATE=$(date +%F) + +PREVPATCH=$(($3-1)) +PREVMIN=$2 +if [[ $PREVPATCH -lt 0 ]]; then + PREVMIN=$(($2-1)) + PREVPATCH="FIXME" + echo "Warning: Previous version needs to be manually modified in [Full Changelog]" +fi +N=$'\n' +NEW="# Change Log${N}${N}## [v$1.$2.$3](https://github.com/ckb-next/ckb-next/tree/v$1.$2.$3) ($DATE)${N}[Full Changelog](https://github.com/ckb-next/ckb-next/compare/v$1.$PREVMIN.$PREVPATCH...v$1.$2.$3)${N}${N}Support for new devices:${N}- ${N}${N}Important bugfixes:${N}- ${N}${N}New features:${N}- ${N}${N}Notes for packagers:${N}- ${N}" +echo "${NEW}${LOG}" > CHANGELOG.md