-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (58 loc) · 1.8 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
VERSION := $(shell poetry run glbm --version | cut -d ":" -f2 | tr -d " ")
.PHONY: build
build: ## make build # Build Python package
@poetry build
.PHONY: test
test: ## make test# Run Pytests for glbm
@poetry run pytest tests/ ${args}
.PHONY: pre-release
pre-release: ## make pre-release Increment 'x' ( 0.0.0-dev.x )
@poetry version prerelease
@./generate_version.py
git add src/gitlab_bm/app_info.py
git add pyproject.toml
git status
.PHONY: update-patch
update-patch: ## make update-patch # Increment 'x' ( 0.0.x )
@poetry version patch
@./generate_version.py
git add src/gitlab_bm/app_info.py
git add pyproject.toml
git status
.PHONY: update-minor
update-minor: ## make update-minor # Increment 'x' ( 0.x.0 )
@poetry version minor
@./generate_version.py
git add src/gitlab_bm/app_info.py
git add pyproject.toml
git status
.PHONY: update-major
update-major: ## make update-major # Increment 'x' ( x.0.0 )
@poetry version major
@./generate_version.py
git add src/gitlab_bm/app_info.py
git add pyproject.toml
git status
.PHONY: update
update: ## make update # Update package dependencies
@poetry update
.PHONY: get-version
get-version: ## make get-version # Get current app version
@poetry run glbm --version
.PHONY: publish-testpypi
publish-testpypi:## make publish-testpypi # Publish package to Test PyPi
@ poetry build
@ poetry publish -r testpypi
@ git tag -a "v$(VERSION)" -m "Dev Release $(VERSION)"
.PHONY: publish
publish:## make publish # Publish package
@poetry build
@poetry publish
@git push origin
@git tag -a "v$(VERSION)" -m "Release version $(VERSION)"
@git push origin "v$(VERSION)"
ifeq ($(MAKECMDGOALS),)
.DEFAULT_GOAL := help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
endif