tools(make): release target

This commit is contained in:
2026-06-15 14:40:07 +02:00
parent 15a937e39c
commit 75c96efc76
+32 -24
View File
@@ -18,22 +18,22 @@ OPEN ?= xdg-open
.PHONY: help .PHONY: help
help: ## show this message help: ## show this message
@echo "Usage: $(MAKE) [target1] [target2] ..." echo "Usage: $(MAKE) [target1] [target2] ..."
@echo "" echo ""
@echo "Commands/Targets:" echo "Commands/Targets:"
@cat $(MAKEFILE_LIST) | grep -E '(^[a-zA-Z0-9_%-]+:.*?##.*$$)|(^##)' | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-20s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/' cat $(MAKEFILE_LIST) | grep -E '(^[a-zA-Z0-9_%-]+:.*?##.*$$)|(^##)' | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-20s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
@echo "" echo ""
@echo "Environment:" echo "Environment:"
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z0-9_-]+\s*\??=.*$$' | grep -Eo '^[a-zA-Z0-9_-]+' | xargs -I {} $(MAKE) -s print-{} 2> /dev/null cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z0-9_-]+\s*\??=.*$$' | grep -Eo '^[a-zA-Z0-9_-]+' | xargs -I {} $(MAKE) -s print-{} 2> /dev/null
.PHONY: print-% .PHONY: print-%
print-%: print-%:
@echo -e '\033[32m$*\033[0m = $($*)' echo -e '\033[32m$*\033[0m = $($*)'
# FILES # FILES
.venv: uv.lock .venv: uv.lock
@$(MAKE) -s uv-sync $(MAKE) -s uv-sync
# ACTIONS # ACTIONS
@@ -57,7 +57,7 @@ test: unittest ## test project
.PHONY: test-% .PHONY: test-%
test-%: ## test project with specific test test-%: ## test project with specific test
@$(MAKE) -s unittest-$* $(MAKE) -s unittest-$*
.PHONY: coverage .PHONY: coverage
coverage: coverage-unittest coverage-xml coverage-report ## test project with coverage coverage: coverage-unittest coverage-xml coverage-report ## test project with coverage
@@ -66,53 +66,61 @@ coverage: coverage-unittest coverage-xml coverage-report ## test project with co
.PHONY: uv-sync .PHONY: uv-sync
uv-sync: ## uv sync uv-sync: ## uv sync
@$(UV) sync --active $(UV) sync --active
.PHONY: uv-update .PHONY: uv-update
uv-upgrade: ## uv sync upgrade uv-upgrade: ## uv sync upgrade
@$(UV) sync --active --upgrade $(UV) sync --active --upgrade
.PHONY: ruff .PHONY: ruff
ruff: .venv ## ruff check ruff: .venv ## ruff check
@$(RUFF) check $(RUFF) check
.PHONY: ruff-fix .PHONY: ruff-fix
ruff-fix: .venv ## ruff check (and fix) ruff-fix: .venv ## ruff check (and fix)
@$(RUFF) check --fix --unsafe-fixes $(RUFF) check --fix --unsafe-fixes
.PHONY: ruff-format .PHONY: ruff-format
ruff-format: .venv ## ruff format ruff-format: .venv ## ruff format
@$(RUFF) format $(RUFF) format
.PHONY: ruff-format-check .PHONY: ruff-format-check
ruff-format-check: .venv ## ruff format (check only) ruff-format-check: .venv ## ruff format (check only)
@$(RUFF) format --check $(RUFF) format --check
.PHONY: ty .PHONY: ty
ty: .venv ## ty check ty: .venv ## ty check
@$(TY) check $(TY) check
.PHONY: unittest .PHONY: unittest
unittest: .venv ## unittest unittest: .venv ## unittest
@$(UNITTEST) -v $(UNITTEST) -v
.PHONY: unittest-% .PHONY: unittest-%
unittest-%: .venv ## unittest -k [filter] unittest-%: .venv ## unittest -k [filter]
@$(UNITTEST) -v -k $* $(UNITTEST) -v -k $*
.PHONY: coverage-unittest .PHONY: coverage-unittest
coverage-unittest: .venv ## coverage run -m unittest coverage-unittest: .venv ## coverage run -m unittest
@$(COVERAGE) run -m unittest -v $(COVERAGE) run -m unittest -v
.PHONY: coverage-report .PHONY: coverage-report
coverage-report: .venv ## coverage report coverage-report: .venv ## coverage report
@$(COVERAGE) report $(COVERAGE) report
.PHONY: coverage-html .PHONY: coverage-html
coverage-html: .venv ## coverage html coverage-html: .venv ## coverage html
@$(COVERAGE) html $(COVERAGE) html
@$(OPEN) htmlcov/index.html || true $(OPEN) htmlcov/index.html || true
.PHONY: coverage-xml .PHONY: coverage-xml
coverage-xml: .venv ## coverage xml coverage-xml: .venv ## coverage xml
@$(COVERAGE) xml $(COVERAGE) xml
.PHONY: release-%
release-%: .venv ## release major/minor/patch
$(UV) version --bump=$*
git add pyproject.toml uv.lock
git commit -m "chore: $$(uv version --short)"
git tag "release/$$(uv version --short)" -m "$$(uv version)"
$(UV) build