Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile release command #84

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/lint_and_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ jobs:
make lint
- name: Build docs
run: |
towncrier build --version 99.99 --name pystack --keep
make docs
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,15 @@ clean: ## Clean any built/generated artifacts
rm -f pystack.info
rm -rf pystack-coverage


.PHONY: check_release_env
check_release_env:
ifndef RELEASE
$(error RELEASE is undefined. Please set it to either ["major", "minor", "patch"])
endif

.PHONY: bump_version
bump_version:
bump_version: check_release_env
bump2version $(RELEASE)
$(eval NEW_VERSION := $(shell bump2version \
--allow-dirty \
Expand All @@ -121,7 +128,7 @@ bump_version:
git commit --amend --no-edit

.PHONY: gen_news
gen_news:
gen_news: check_release_env
$(eval CURRENT_VERSION := $(shell bump2version \
--allow-dirty \
--dry-run \
Expand All @@ -131,7 +138,7 @@ gen_news:
$(PYEXEC) towncrier build --version $(CURRENT_VERSION) --name pystack

.PHONY: release
release: bump_version gen_news ## Prepare release
release: check_release_env bump_version gen_news ## Prepare release

.PHONY: help
help: ## Print this message
Expand Down