Compare commits

..

No commits in common. "main" and "0.2.0" have entirely different histories.
main ... 0.2.0

4 changed files with 11 additions and 16 deletions

View File

@ -7,7 +7,8 @@ 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([a-zA-Z0-9-_!\&\.\%\(\)\=\w\s]+)\s?(,?\s?)((ref(s?):?\s?)(([A-Z0-9]+\-[0-9]+)|(NOISSUE))))|(release: .*)$'
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))))|(release: .*)$"
# Check if the commit message matches the conventional commit format
if ! echo "$commit" | grep -Pq "$regex"

View File

@ -46,7 +46,6 @@ create_file() {
}
get_commit_range() {
rm $TEMP_FILE_PATH/messages.txt
if [[ $LAST_TAG =~ $PATTERN ]]; then
create_file true
else
@ -63,20 +62,16 @@ start() {
increment_type=""
while read message; do
echo $message
if echo $message | grep -Pq '(feat|style)(\([\w]+\))?!:([a-zA-Z0-9-_!\&\.\%\(\)\=\w\s]+)\s?(,?\s?)((ref(s?):?\s?)(([A-Z0-9]+\-[0-9]+)|(NOISSUE)))'; then
if [[ $message =~ (([a-zA-Z]+)(\(.+\))?\!:)|(BREAKING CHANGE:) ]]; then
increment_type="major"
echo "a"
break
elif echo $message | grep -Pq '(feat|style)(\([\w]+\))?:([a-zA-Z0-9-_!\&\.\%\(\)\=\w\s]+)\s?(,?\s?)((ref(s?):?\s?)(([A-Z0-9]+\-[0-9]+)|(NOISSUE)))'; then
elif [[ $message =~ (^(feat|style)(\(.+\))?:) ]]; then
if [ -z "$increment_type" ] || [ "$increment_type" == "patch" ]; then
increment_type="minor"
echo "b"
fi
elif echo $message | grep -Pq '(build|fix|perf|refactor|revert)(\(.+\))?:\s([a-zA-Z0-9-_!\&\.\%\(\)\=\w\s]+)\s?(,?\s?)((ref(s?):?\s?)(([A-Z0-9]+\-[0-9]+)|(NOISSUE)))'; then
fi
elif [[ $message =~ ^((fix|build|perf|refactor|revert)(\(.+\))?:) ]]; then
if [ -z "$increment_type" ]; then
increment_type="patch"
echo "c"
fi
fi
done < $TEMP_FILE_PATH/messages.txt
@ -87,10 +82,9 @@ start() {
gitchangelog | grep -v "[rR]elease:" > HISTORY.md
git add DotnetTestLib/VERSION HISTORY.md
echo $new_version > DotnetTestLib/VERSION
git commit -m "release: version $new_version 🚀"
echo "creating git tag : $new_version"
git tag $new_version
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

View File

@ -1 +1 @@
0.2.0
0.1.17

View File

@ -46,7 +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"
./.gitea/conventional_commits/generate-version.sh
. ./.gitea/conventional_commits/generate-version.sh
.PHONY: docs
docs: issetup ## Build the documentation.