From 515792834fc426138bd880439384ab15994cc019 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Fri, 15 Sep 2023 11:08:21 +0200 Subject: [PATCH] update --- .release_notes.tpl | 22 ++++++++++++++++++++++ Makefile | 15 ++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 .release_notes.tpl diff --git a/.release_notes.tpl b/.release_notes.tpl new file mode 100644 index 00000000..b8449d3e --- /dev/null +++ b/.release_notes.tpl @@ -0,0 +1,22 @@ +{{#general_title}} +# {{{title}}} + + +{{/general_title}} +{{#versions}} +## {{{label}}} + +{{#sections}} +#### {{{label}}} + +{{#commits}} +* {{{subject}}} +{{#body}} + _{{{body}}}_ +{{/body}} + +{{/commits}} +{{/sections}} + + +{{/versions}} \ No newline at end of file diff --git a/Makefile b/Makefile index 88992c33..6dd12102 100644 --- a/Makefile +++ b/Makefile @@ -109,16 +109,17 @@ release: ## Create a new tag for release. [[ "$$TAG" =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(\.dev)?$$ ]] || { echo "Incorrect tag. e.g., 1.2.3 or 1.2.3.dev"; exit 1; } && \ IFS="." read -r -a VERSION_ARRAY <<< "$$TAG" && \ BUILD_NUMBER=$$(( $${VERSION_ARRAY[0]} * 10000 + $${VERSION_ARRAY[1]} * 100 + $${VERSION_ARRAY[2]} )) && \ - echo "version: $${TAG}+$${BUILD_NUMBER}" && \ - sed -i "s/version: .*/version: $${TAG}+$${BUILD_NUMBER}/g" pubspec.yaml && \ - git tag $${TAG} && \ - gitchangelog > changelog.md || { git tag -d $${TAG}; echo "Please run pip install gitchangelog"; exit 2; } && \ - git tag -d $${TAG} && \ + VERSION_STR="$${VERSION_ARRAY[0]}.$${VERSION_ARRAY[1]}.$${VERSION_ARRAY[2]}" && \ + echo "version: $${VERSION_STR}+$${BUILD_NUMBER}" && \ + sed -i "s/version: .*/version: $${VERSION_STR}+$${BUILD_NUMBER}/g" pubspec.yaml && \ + git tag $${TAG} > /dev/null && \ + gitchangelog > changelog.md || { git tag -d $${TAG}; echo "Please run pip install git gitchangelog pystache mustache markdown"; exit 2; } && \ + git tag -d $${TAG} > /dev/null && \ git add pubspec.yaml changelog.md && \ # ./update_translations.sh && \ # git add assets/translations/* && \ git commit -m "release: version $${TAG} 🚀" && \ echo "creating git tag : $${TAG}" && \ - @git tag $${TAG} && \ - @git push -u origin HEAD --tags && \ + git tag $${TAG} && \ + git push -u origin HEAD --tags && \ echo "Github Actions will detect the new tag and release the new version."' \ No newline at end of file