Dotnet_Library/Makefile

60 lines
1.8 KiB
Makefile
Raw Normal View History

2024-11-27 21:28:19 +01:00
.ONESHELL:
2024-11-27 20:44:34 +01:00
.PHONY: help
help: ## Show the help.
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@fgrep "##" Makefile | fgrep -v fgrep
.PHONY: buildrel
buildrel: ## Format code.
dotnet build -c Release project_name.sln
.PHONY: build
build: ## Format code.
dotnet build project_name.sln
.PHONY: publish
publish: ## Format code.
dotnet publish -c Release project_name.sln
.PHONY: fmt
fmt: ## Format code.
dotnet format project_name.sln
.PHONY: lint
lint: ## Lint code.
dotnet format --verify-no-changes --verbosity diagnostic project_name.sln
.PHONY: test
test: ## Run tests and generate coverage report.
dotnet test project_name.sln
.PHONY: clean
clean: ## Clean unused files.
dotnet clean project_name.sln
.PHONY: release
release: ## Create a new tag for release.
@echo "WARNING: This operation will create a version tag and push to gitea"
2024-11-27 21:28:19 +01:00
@read -p "Version? (provide the next x.y.z semver) : " TAG; echo "$$TAG" > project_name/VERSION
@gitchangelog > HISTORY.md
2024-11-27 20:44:34 +01:00
@git add project_name/VERSION HISTORY.md
2024-11-27 21:28:19 +01:00
@git commit -m "release: version $$(cat project_name/VERSION) 🚀"
@echo "creating git tag : $$(cat project_name/VERSION)"
@git tag $$(cat project_name/VERSION)
2024-11-27 20:44:34 +01:00
@git push -u origin HEAD --tags
@echo "Gitea Actions will detect the new tag and release the new version."
.PHONY: docs
docs: ## Build the documentation.
@echo "building documentation ..."
2024-11-27 21:28:19 +01:00
@mkdocs build
2024-11-27 20:44:34 +01:00
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/