feat(concom): fix tag generation ref: NOISSUE

This commit is contained in:
Simon Diesenreiter 2024-11-30 20:05:52 +01:00
parent 81611c0dd1
commit a5b1854956
4 changed files with 106 additions and 15 deletions

View File

@ -7,7 +7,7 @@ echo "Running commit message checks..."
# Get the commit message
commit="$(cat .git/COMMIT_EDITMSG)"
# Define the conventional commit regex
regex="^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.+\))?(!?):\s(.+)\s((ref(s?):?\s?)[A-Z0-9]+\-[0-9]+)$"
regex="^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.+\))?(!?):\s([a-zA-Z0-9-_!\&\.\%\"\'\(\)\=\w\s]+)\s?(,?\s?)((ref(s?):?\s?)(([A-Z0-9]+\-[0-9]+)|(NOISSUE)))$"
# Check if the commit message matches the conventional commit format

View File

@ -5,10 +5,7 @@
# minor: feat, style
# patch: build, fix, perf, refactor, revert
GENERATE_VERSION=$1
echo "Generate version: $GENERATE_VERSION"
PREVENT_REMOVE_FILE=$2
PREVENT_REMOVE_FILE=$1
TEMP_FILE_PATH=.gitea/conventional_commits/tmp
LAST_TAG=$(git describe --tags --abbrev=0 --always)
@ -65,7 +62,7 @@ start() {
increment_type=""
while read message; do
if [[ $message =~ (([a-z]+)(\(.+\))?\!:)|(BREAKING CHANGE:) ]]; then
if [[ $message =~ (([a-zA-Z]+)(\(.+\))?\!:)|(BREAKING CHANGE:) ]]; then
increment_type="major"
break
elif [[ $message =~ (^(feat|style)(\(.+\))?:) ]]; then
@ -82,7 +79,14 @@ start() {
if [ -n "$increment_type" ]; then
new_version=$(increment_version $LAST_TAG $increment_type)
echo "New version: $new_version"
push_newversion $new_version
gitchangelog | grep -v "[rR]elease:" > HISTORY.md
git add DotnetTestLib/VERSION HISTORY.md
git commit -m "release: version $(cat DotnetTestLib/VERSION) 🚀"
echo "creating git tag : $(cat DotnetTestLib/VERSION)"
git tag $(cat DotnetTestLib/VERSION)
git push -u origin HEAD --tags
echo "Gitea Actions will detect the new tag and release the new version."
else
echo "No changes requiring a version increment."
fi

View File

@ -0,0 +1,94 @@
Changelog
=========
(unreleased)
------------
- Ci: add conventional commit support ref: NOISSUE. [Simon Diesenreiter]
- Fix conflict. [Simon Diesenreiter]
0.1.17 (2024-11-28)
-------------------
- Fix auth. [Simon Diesenreiter]
0.1.16 (2024-11-28)
-------------------
0.1.15 (2024-11-28)
-------------------
0.1.14 (2024-11-28)
-------------------
0.1.13 (2024-11-28)
-------------------
- Another fix 3.0. [Simon Diesenreiter]
0.1.12 (2024-11-28)
-------------------
0.1.11 (2024-11-28)
-------------------
- Another fix 2.0. [Simon Diesenreiter]
0.1.10 (2024-11-28)
-------------------
- Another fix. [Simon Diesenreiter]
0.1.9 (2024-11-27)
------------------
- Package source fix. [Simon Diesenreiter]
0.1.8 (2024-11-27)
------------------
- More fixes. [Simon Diesenreiter]
0.1.7 (2024-11-27)
------------------
- Fixed it. [Simon Diesenreiter]
0.1.6 (2024-11-27)
------------------
- Test. [Simon Diesenreiter]
0.1.5 (2024-11-27)
------------------
- Woohoo. [Simon Diesenreiter]
0.1.4 (2024-11-27)
------------------
- Fix bug. [Simon Diesenreiter]
0.1.3 (2024-11-27)
------------------
0.1.2 (2024-11-27)
------------------
- More bugs fixed. [Simon Diesenreiter]
- Update Makefile. [Simon Diesenreiter]
0.1.1 (2024-11-27)
------------------
- Bugfixes. [Simon Diesenreiter]
- ✅ Ready to clone and code. [simon]
- Init project. [Simon Diesenreiter]
- Initial commit. [Projects <>]

View File

@ -46,14 +46,7 @@ clean: issetup ## Clean unused files.
.PHONY: release
release: issetup ## Create a new tag for release.
@echo "WARNING: This operation will create a version tag and push to gitea"
@read -p "Version? (provide the next x.y.z semver) : " TAG; echo "$$TAG" > DotnetTestLib/VERSION
@gitchangelog > HISTORY.md
@git add DotnetTestLib/VERSION HISTORY.md
@git commit -m "release: version $$(cat DotnetTestLib/VERSION) 🚀"
@echo "creating git tag : $$(cat DotnetTestLib/VERSION)"
@git tag $$(cat DotnetTestLib/VERSION)
@git push -u origin HEAD --tags
@echo "Gitea Actions will detect the new tag and release the new version."
. ./.gitea/conventional_commits/generate-version.sh
.PHONY: docs
docs: issetup ## Build the documentation.