DotnetTestLib/Makefile

68 lines
2.1 KiB
Makefile
Raw Normal View History

2024-11-27 21:29:03 +01:00
.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/
2024-11-27 12:07:20 -08:00
.PHONY: help
help: ## Show the help.
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@fgrep "##" Makefile | fgrep -v fgrep
.PHONY: buildrel
buildrel: issetup ## Format code.
2024-11-27 20:09:05 +00:00
dotnet build -c Release DotnetTestLib.sln
2024-11-27 12:07:20 -08:00
.PHONY: build
build: issetup ## Format code.
2024-11-27 20:09:05 +00:00
dotnet build DotnetTestLib.sln
2024-11-27 12:07:20 -08:00
.PHONY: publish
publish: issetup ## Format code.
2024-11-27 20:09:05 +00:00
dotnet publish -c Release DotnetTestLib.sln
2024-11-27 12:07:20 -08:00
.PHONY: fmt
fmt: issetup ## Format code.
2024-11-27 20:09:05 +00:00
dotnet format DotnetTestLib.sln
2024-11-27 12:07:20 -08:00
.PHONY: lint
lint: issetup ## Lint code.
2024-11-27 20:09:05 +00:00
dotnet format --verify-no-changes --verbosity diagnostic DotnetTestLib.sln
2024-11-27 12:07:20 -08:00
.PHONY: test
test: issetup ## Run tests and generate coverage report.
2024-11-27 20:09:05 +00:00
dotnet test DotnetTestLib.sln
2024-11-27 12:07:20 -08:00
.PHONY: clean
clean: issetup ## Clean unused files.
2024-11-27 20:09:05 +00:00
dotnet clean DotnetTestLib.sln
2024-11-27 12:07:20 -08:00
.PHONY: release
release: issetup ## Create a new tag for release.
2024-11-27 12:07:20 -08:00
@echo "WARNING: This operation will create a version tag and push to gitea"
2024-11-27 21:38:49 +01:00
@read -p "Version? (provide the next x.y.z semver) : " TAG; echo "$$TAG" > DotnetTestLib/VERSION
2024-11-27 21:29:03 +01:00
@gitchangelog > HISTORY.md
2024-11-27 21:38:49 +01:00
@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)
2024-11-27 12:07:20 -08:00
@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.
2024-11-27 12:07:20 -08:00
@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/