File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,4 +32,24 @@ if [[ -f $APPDATA_FILE ]]; then
3232 sed -i -E " s/(<release version=\" )[^\" ]*(\" date=\" )[^\" ]*(\" )/\1${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH} \2${DATE_ISO} \3/" " $APPDATA_FILE " || exit 1
3333else
3434 echo " Warning: ${APPDATA_FILE} does not exist, skipping."
35+ fi
36+
37+ CHANGELOG=" CHANGELOG"
38+ if [[ -f $CHANGELOG ]]; then
39+ echo " Updating ${CHANGELOG} .."
40+ RFC_DATE=$( ./scripts/rfc2822Time)
41+ VERSION=" ${VERSION_MAJOR} .${VERSION_MINOR} .${VERSION_PATCH} "
42+
43+ # Replace first x.y.z with version
44+ sed -i " 0,/x.y.z/s/x.y.z/$VERSION /" " $CHANGELOG " || exit 1
45+
46+ # Replace first "Release date:" with "Release date:\n\n$RFC_DATE"
47+ sed -i " 0,/Release date:/s/Release date:/Release date:\n\n$RFC_DATE /" " $CHANGELOG " || exit 1
48+
49+ # Prepend the new template
50+ printf " x.y.z\n=====\n\nRelease date:\n\nNew features:\n\nBug fixes:\n\nOther:\n\n" > " $CHANGELOG .new"
51+ cat " $CHANGELOG " >> " $CHANGELOG .new"
52+ mv " $CHANGELOG .new" " $CHANGELOG "
53+ else
54+ echo " Warning: ${CHANGELOG} does not exist, skipping."
3555fi
You can’t perform that action at this time.
0 commit comments