Skip to content

Commit

Permalink
new: automated version release
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Sep 15, 2023
1 parent e25a053 commit d0e7625
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .gitchangelog.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#output_engine = mustache("markdown")
output_engine = mustache(".release_notes.tpl")


tag_filter_regexp = r'^v?[0-9]+\.[0-9]+(\.[0-9]+)?$'

ignore_regexps = [
r'@minor', r'!minor',
r'@cosmetic', r'!cosmetic',
r'@refactor', r'!refactor',
r'@wip', r'!wip',
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[p|P]kg:',
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[d|D]ev:',
r'^(.{3,3}\s*:)?\s*[fF]irst commit.?\s*$',
r'^$', ## ignore commits with empty messages
r'release: *',
]
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,29 @@ build-macos-libs:

build-ios-libs: #not tested
make -C libcore -f Makefile ios && mv $(BINDIR)/$(CORE_NAME)-ios.xcframework $(DESKTOP_OUT)/libcore.xcframework




release: ## Create a new tag for release.
@echo "previous version was $$(git describe --tags $$(git rev-list --tags --max-count=1))"
@echo "WARNING: This operation will creates version tag and push to github"
@bash -c '\
read -p "Version? (provide the next x.y.z semver) : " TAG && \
echo $$TAG &&\
[[ "$$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} && \
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 && \
echo "Github Actions will detect the new tag and release the new version."'
Empty file added changelog.md
Empty file.
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: hiddify
description: A Proxy Frontend.
publish_to: "none"
version: 0.1.0
version: 1.1.1+10101

environment:
sdk: ">=3.0.5 <4.0.0"
Expand Down

0 comments on commit d0e7625

Please sign in to comment.