DotnetTestLib/Makefile
Simon Diesenreiter 81611c0dd1
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
ci: add conventional commit support ref: NOISSUE
2024-11-30 10:23:58 -08:00

68 lines
2.1 KiB
Makefile

.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>"
@echo ""
@echo "Targets:"
@fgrep "##" Makefile | fgrep -v fgrep
.PHONY: buildrel
buildrel: issetup ## Format code.
dotnet build -c Release DotnetTestLib.sln
.PHONY: build
build: issetup ## Format code.
dotnet build DotnetTestLib.sln
.PHONY: publish
publish: issetup ## Format code.
dotnet publish -c Release DotnetTestLib.sln
.PHONY: fmt
fmt: issetup ## Format code.
dotnet format DotnetTestLib.sln
.PHONY: lint
lint: issetup ## Lint code.
dotnet format --verify-no-changes --verbosity diagnostic DotnetTestLib.sln
.PHONY: test
test: issetup ## Run tests and generate coverage report.
dotnet test DotnetTestLib.sln
.PHONY: clean
clean: issetup ## Clean unused files.
dotnet clean DotnetTestLib.sln
.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."
.PHONY: docs
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
# This project has been generated from rochacbruno/python-project-template
# __author__ = 'rochacbruno'
# __repo__ = https://github.com/rochacbruno/python-project-template
# __sponsor__ = https://github.com/sponsors/rochacbruno/