Compare commits

..

16 Commits
0.1.12 ... main

Author SHA1 Message Date
cb4f507485 chore: fix some bugs with conventional commits, ref NOISSUE
Some checks failed
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m36s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
SonarQube Scan / SonarQube Trigger (push) Successful in 1m40s
2024-11-30 21:00:52 +01:00
821d7ba0aa release: version 0.1.17 🚀
Some checks failed
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m52s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
SonarQube Scan / SonarQube Trigger (push) Successful in 1m53s
Upload Python Package / Create Release (push) Successful in 9s
Upload Python Package / deploy (push) Failing after 1m26s
2024-11-30 20:13:30 +01:00
17b78ced78 feat: test ref NOISSUE 2024-11-30 20:13:05 +01:00
3312faeaa5 release: version 0.1.17 🚀
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Waiting to run
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m31s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
2024-11-30 20:09:44 +01:00
56b9233987 ci(concom): fix error again refs NOISSUE
Some checks failed
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m42s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
SonarQube Scan / SonarQube Trigger (push) Successful in 1m48s
2024-11-30 20:07:15 +01:00
d490337699 ci(concom): fix error refs NOISSUE 2024-11-30 20:06:45 +01:00
a5b1854956 feat(concom): fix tag generation ref: NOISSUE 2024-11-30 20:05:52 +01:00
81611c0dd1 ci: add conventional commit support ref: NOISSUE
Some checks failed
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m47s
SonarQube Scan / SonarQube Trigger (push) Successful in 1m46s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
2024-11-30 10:23:58 -08:00
ba771d2cfd fix conflict
All checks were successful
CI / linter (9.0.X, ubuntu-latest) (push) Successful in 1m40s
SonarQube Scan / SonarQube Trigger (push) Successful in 1m39s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Successful in 1m23s
2024-11-28 01:43:12 -08:00
d274e8849d release: version 0.1.17 🚀
Some checks failed
Upload Python Package / Create Release (push) Successful in 1m12s
SonarQube Scan / SonarQube Trigger (push) Successful in 1m41s
CI / linter (9.0.X, ubuntu-latest) (push) Successful in 1m54s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Successful in 1m21s
Upload Python Package / deploy (push) Failing after 1m26s
2024-11-28 01:32:12 -08:00
56ad94337f fix auth
Some checks failed
CI / linter (9.0.X, ubuntu-latest) (push) Successful in 1m35s
SonarQube Scan / SonarQube Trigger (push) Successful in 1m36s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
2024-11-28 01:29:55 -08:00
f5881e6929 release: version 0.1.16 🚀
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Successful in 1m52s
CI / linter (9.0.X, ubuntu-latest) (push) Successful in 1m53s
Upload Python Package / Create Release (push) Successful in 1m52s
Upload Python Package / deploy (push) Failing after 2m40s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Successful in 2m41s
2024-11-28 01:22:32 -08:00
ad9822a4d3 release: version 0.1.15 🚀
Some checks are pending
Upload Python Package / deploy (push) Blocked by required conditions
Upload Python Package / Create Release (push) Successful in 1m11s
CI / linter (9.0.X, ubuntu-latest) (push) Successful in 1m45s
SonarQube Scan / SonarQube Trigger (push) Successful in 1m46s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Successful in 1m19s
2024-11-28 01:14:16 -08:00
198f3f3d05 release: version 0.1.14 🚀
Some checks are pending
Upload Python Package / deploy (push) Blocked by required conditions
Upload Python Package / Create Release (push) Successful in 1m15s
CI / linter (9.0.X, ubuntu-latest) (push) Successful in 1m48s
SonarQube Scan / SonarQube Trigger (push) Successful in 1m47s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Successful in 1m25s
2024-11-28 01:09:02 -08:00
7c8cf40573 release: version 0.1.13 🚀
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 2s
Upload Python Package / Create Release (push) Failing after 2s
Upload Python Package / deploy (push) Has been skipped
CI / linter (9.0.X, ubuntu-latest) (push) Successful in 1m24s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Successful in 1m26s
2024-11-28 00:57:47 -08:00
858bd4a041 another fix 3.0
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 1s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
2024-11-28 00:52:31 -08:00
8 changed files with 322 additions and 24 deletions

View File

@ -0,0 +1,47 @@
#!/usr/bin/env sh
echo "Running commit message checks..."
. "$(dirname -- "$0")/../../.gitea/conventional_commits/hooks/text-styles.sh"
# 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: .*)$'
# Check if the commit message matches the conventional commit format
if ! echo "$commit" | grep -Pq "$regex"
then
echo
colorPrint red "❌ Failed to create commit. Your commit message does not follow the conventional commit format."
colorPrint red "Please use the following format: $(colorPrint brightRed 'type(scope)?: description')"
colorPrint red "Available types are listed below. Scope is optional. Use ! after type to indicate breaking change."
echo
colorPrint brightWhite "Quick examples:"
echo "feat: add email notifications on new direct messages refs ABC-1213"
echo "feat(shopping cart): add the amazing button ref: DEFG-23"
echo "feat!: remove ticket list endpoint ref DADA-109"
echo "fix(api): handle empty message in request body refs: MINE-82"
echo "chore(deps): bump some-package-name to version 2.0.0 refs ASDF-12"
echo
colorPrint brightWhite "Commit types:"
colorPrint brightCyan "build: $(colorPrint white "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)" -n)"
colorPrint brightCyan "ci: $(colorPrint white "Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)" -n)"
colorPrint brightCyan "chore: $(colorPrint white "Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries" -n)"
colorPrint brightCyan "docs: $(colorPrint white "Documentation only changes" -n)"
colorPrint brightCyan "feat: $(colorPrint white "A new feature" -n)"
colorPrint brightCyan "fix: $(colorPrint white "A bug fix" -n)"
colorPrint brightCyan "perf: $(colorPrint white "A code change that improves performance" -n)"
colorPrint brightCyan "refactor: $(colorPrint white "A code change that neither fixes a bug nor adds a feature" -n)"
colorPrint brightCyan "revert: $(colorPrint white "Revert a change previously introduced" -n)"
colorPrint brightCyan "test: $(colorPrint white "Adding missing tests or correcting existing tests" -n)"
echo
colorPrint brightWhite "Reminders"
echo "Put newline before extended commit body"
echo "More details at $(underline "http://www.conventionalcommits.org")"
echo
echo "The commit message you attempted was: $commit"
echo
exit 1
fi

View File

@ -0,0 +1,105 @@
#!/bin/bash
# Rules for generating semantic versioning
# major: breaking change
# minor: feat, style
# patch: build, fix, perf, refactor, revert
PREVENT_REMOVE_FILE=$1
TEMP_FILE_PATH=.gitea/conventional_commits/tmp
LAST_TAG=$(git describe --tags --abbrev=0 --always)
echo "Last tag: #$LAST_TAG#"
PATTERN="^[0-9]+\.[0-9]+\.[0-9]+$"
increment_version() {
local version=$1
local increment=$2
local major=$(echo $version | cut -d. -f1)
local minor=$(echo $version | cut -d. -f2)
local patch=$(echo $version | cut -d. -f3)
if [ "$increment" == "major" ]; then
major=$((major + 1))
minor=0
patch=0
elif [ "$increment" == "minor" ]; then
minor=$((minor + 1))
patch=0
elif [ "$increment" == "patch" ]; then
patch=$((patch + 1))
fi
echo "${major}.${minor}.${patch}"
}
create_file() {
local with_range=$1
if [ -s $TEMP_FILE_PATH/messages.txt ]; then
return 1
fi
if [ "$with_range" == "true" ]; then
git log $LAST_TAG..HEAD --no-decorate --pretty=format:"%s" > $TEMP_FILE_PATH/messages.txt
else
git log --no-decorate --pretty=format:"%s" > $TEMP_FILE_PATH/messages.txt
fi
}
get_commit_range() {
rm $TEMP_FILE_PATH/messages.txt
if [[ $LAST_TAG =~ $PATTERN ]]; then
create_file true
else
create_file
LAST_TAG="0.0.0"
fi
echo " " >> $TEMP_FILE_PATH/messages.txt
}
start() {
mkdir -p $TEMP_FILE_PATH
get_commit_range
new_version=$LAST_TAG
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
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
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
if [ -z "$increment_type" ]; then
increment_type="patch"
echo "c"
fi
fi
done < $TEMP_FILE_PATH/messages.txt
if [ -n "$increment_type" ]; then
new_version=$(increment_version $LAST_TAG $increment_type)
echo "New version: $new_version"
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 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
}
start
if [ -z "$PREVENT_REMOVE_FILE" ]; then
rm -f $TEMP_FILE_PATH/messages.txt
fi

View File

@ -0,0 +1,44 @@
#!/bin/sh
colorPrint() {
local color=$1
local text=$2
shift 2
local newline="\n"
local tab=""
for arg in "$@"
do
if [ "$arg" = "-t" ]; then
tab="\t"
elif [ "$arg" = "-n" ]; then
newline=""
fi
done
case $color in
black) color_code="30" ;;
red) color_code="31" ;;
green) color_code="32" ;;
yellow) color_code="33" ;;
blue) color_code="34" ;;
magenta) color_code="35" ;;
cyan) color_code="36" ;;
white) color_code="37" ;;
brightBlack) color_code="90" ;;
brightRed) color_code="91" ;;
brightGreen) color_code="92" ;;
brightYellow) color_code="93" ;;
brightBlue) color_code="94" ;;
brightMagenta) color_code="95" ;;
brightCyan) color_code="96" ;;
brightWhite) color_code="97" ;;
*) echo "Invalid color"; return ;;
esac
printf "\e[${color_code}m${tab}%s\e[0m${newline}" "$text"
}
underline () {
printf "\033[4m%s\033[24m" "$1"
}

View File

@ -50,14 +50,16 @@ jobs:
fi
- name: Build and publish
env:
GITEA_USERNAME: gitearobot
GITEA_PASSWORD: ${{ secrets.PACKAGE_GITEA_PAT }}
GITEA_PAT: ${{ secrets.PACKAGE_GITEA_PAT }}
run: |
REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}')
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
REPOSITORY_SOURCE_NAME=gitea-repo
if [ -z "$(dotnet nuget config get all | grep "/packages/${REPOSITORY_OWNER}/nuget/index.json")" ]; then
dotnet nuget add source --name gitea --username $GITEA_USERNAME --password $GITEA_PASSWORD https://git.disi.dev/api/packages/$REPOSITORY_OWNER/nuget/index.json
dotnet nuget add source --name $REPOSITORY_SOURCE_NAME https://git.disi.dev/api/packages/$REPOSITORY_OWNER/nuget/index.json
else
QUOTED_REPOSITORY_SOURCE_NAME=$(dotnet nuget config get all | grep "/packages/${REPOSITORY_OWNER}/nuget/index.json" | awk '{print $2}' | awk -F= '{print $2}')
REPOSITORY_SOURCE_NAME=${QUOTED_REPOSITORY_SOURCE_NAME:1:-1}
fi
dotnet pack --include-symbols --include-source -p:PackageVersion=$(cat $REPOSITORY_NAME/VERSION) DotnetTestLib.sln
dotnet nuget push --source gitea $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).nupkg
dotnet nuget push --source gitea $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).symbols.nupkg
dotnet nuget push -k $GITEA_PAT --source $REPOSITORY_SOURCE_NAME $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).symbols.nupkg

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
**/bin
**/obj
**/obj
.gitea/conventional_commits/tmp/*

View File

@ -1 +1 @@
0.1.12
0.2.0

View File

@ -0,0 +1,98 @@
Changelog
=========
(unreleased)
------------
- Feat: test ref NOISSUE. [Simon Diesenreiter]
- Ci(concom): fix error again refs NOISSUE. [Simon Diesenreiter]
- Ci(concom): fix error refs NOISSUE. [Simon Diesenreiter]
- Feat(concom): fix tag generation ref: NOISSUE. [Simon Diesenreiter]
- 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

@ -1,5 +1,13 @@
.ONESHELL:
.PHONY: issetup
issetup:
@[ -f .git/hooks/commit-msg ] || (echo "You must run 'make setup' first to initialize the repo!" && exit 1)
.PHONY: setup
setup:
@cp .gitea/conventional_commits/commit-msg .git/hooks/
.PHONY: help
help: ## Show the help.
@echo "Usage: make <target>"
@ -8,47 +16,40 @@ help: ## Show the help.
@fgrep "##" Makefile | fgrep -v fgrep
.PHONY: buildrel
buildrel: ## Format code.
buildrel: issetup ## Format code.
dotnet build -c Release DotnetTestLib.sln
.PHONY: build
build: ## Format code.
build: issetup ## Format code.
dotnet build DotnetTestLib.sln
.PHONY: publish
publish: ## Format code.
publish: issetup ## Format code.
dotnet publish -c Release DotnetTestLib.sln
.PHONY: fmt
fmt: ## Format code.
fmt: issetup ## Format code.
dotnet format DotnetTestLib.sln
.PHONY: lint
lint: ## Lint code.
lint: issetup ## Lint code.
dotnet format --verify-no-changes --verbosity diagnostic DotnetTestLib.sln
.PHONY: test
test: ## Run tests and generate coverage report.
test: issetup ## Run tests and generate coverage report.
dotnet test DotnetTestLib.sln
.PHONY: clean
clean: ## Clean unused files.
clean: issetup ## Clean unused files.
dotnet clean DotnetTestLib.sln
.PHONY: release
release: ## Create a new tag for 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: ## Build the documentation.
docs: issetup ## Build the documentation.
@echo "building documentation ..."
@$(ENV_PREFIX)mkdocs build
URL="site/index.html"; xdg-open $$URL || sensible-browser $$URL || x-www-browser $$URL || gnome-open $$URL || open $$URL