Skip to content

Commit 8064d3d

Browse files
committed
Added release tooling in a Makefile
1 parent e9666f5 commit 8064d3d

2 files changed

Lines changed: 119 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Changelog
2+
3+
## Unreleased (2022-03-05)
4+
5+
### New
6+
7+
- Added `Slice` and `FirstRegExMatchPosition` actions. [Corey Oordt](coreyoordt@gmail.com)
8+
- `Slice` will slice the input text when called
9+
- `FirstRegExMatchPosition` will return the position of the first match of the regular expression.
10+
11+
- Added `IncrementalFileInsert` action. [Corey Oordt](coreyoordt@gmail.com)
12+
Simplifies incremental change log generation for the output action.
13+
14+
- Added `create_if_missing` option to `ReadFile`. [Corey Oordt](coreyoordt@gmail.com)
15+
Allows for the creation of an empty file when trying to read from a non-existent file.
16+
17+
- Added MIT license and entry point config for CLI. [Corey Oordt](coreyoordt@gmail.com)
18+
19+
### Updates
20+
21+
- Updated command line interface. [Corey Oordt](coreyoordt@gmail.com)
22+
23+
- Updated configuration. [Corey Oordt](coreyoordt@gmail.com)
24+
- Fixed `DEFAULT_IGNORE_PATTERNS` with commas
25+
- Updated `DEFAULT_STARTING_TAG_PIPELINE` with better pattern
26+
- Added `chg` to ``DEFAULT_SECTION_PATTERNS`
27+
- Added `DEFAULT_OUTPUT_PIPELINE` for incremental changes
28+
- Added `valid_author_tokens` to configuration
29+
30+
- Updated tests for pipelines. [Corey Oordt](coreyoordt@gmail.com)
31+
32+
- Updates the commit template and rendering. [Corey Oordt](coreyoordt@gmail.com)
33+
34+
- Updated `eval_if_callable`. [Corey Oordt](coreyoordt@gmail.com)
35+
- Will now instantiate actions or pipelines and run them.
36+
37+
- Renamed `GetFirstRegExMatch` to `FirstRegExMatch`. [Corey Oordt](coreyoordt@gmail.com)
38+
39+
### Fixes
40+
41+
- Fixed the `include_merges` setting. [Corey Oordt](coreyoordt@gmail.com)
42+
Wasn't hooked up with the git_ops module.
43+
44+
- Fixed a bug in the capitalize action. [Corey Oordt](coreyoordt@gmail.com)
45+
Used to capitalize the first letter but also convert all other characters to lowercase.
46+
47+
### Other
48+
49+
- Moved `VALID_AUTHOR_TOKENS` from templating to configuration. [Corey Oordt](coreyoordt@gmail.com)
50+
51+
52+
## 0.1.0 (2022-03-01)
53+
54+
### Other
55+
56+
- Initial commit. [Corey Oordt](coreyoordt@gmail.com)

Makefile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.PHONY: release-dev release-patch release-minor release-major help dummy do-release
2+
.DEFAULT_GOAL := help
3+
4+
RELEASE_KIND := patch
5+
BRANCH_NAME := $(shell echo $$(git rev-parse --abbrev-ref HEAD))
6+
SHORT_BRANCH_NAME := $(shell echo $(BRANCH_NAME) | cut -c 1-20)
7+
PRIMARY_BRANCH_NAME := master
8+
BUMPVERSION_OPTS :=
9+
EDIT_CHANGELOG := $(shell if [[ -n $$EDITOR ]] ; then echo "$$EDITOR CHANGELOG.md" ; fi)
10+
11+
help:
12+
@grep '^[a-zA-Z]' $(MAKEFILE_LIST) | sort | awk -F ':.*?## ' 'NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'
13+
14+
release-dev: set-release-kind-dev do-release ## Release a new development version: 1.1.1 -> 1.1.1+branchname-1
15+
16+
release-patch: set-release-kind-patch do-release ## Release a new patch version: 1.1.1 -> 1.1.2
17+
18+
release-minor: set-release-kind-minor do-release ## Release a new minor version: 1.1.1 -> 1.2.0
19+
20+
release-major: set-release-kind-major do-release ## Release a new major version: 1.1.1 -> 2.0.0
21+
22+
release-version: get-version do-release ## Release a specific version: release-version 1.2.3
23+
24+
#
25+
# Helper targets. Not meant to use directly
26+
#
27+
28+
do-release:
29+
ifeq ($(BRANCH_NAME), $(PRIMARY_BRANCH_NAME))
30+
ifeq ($(RELEASE_KIND), dev)
31+
@echo "Error! Can't bump $(RELEASE_KIND) while on the $(PRIMARY_BRANCH_NAME) branch."
32+
exit
33+
endif
34+
else ifneq ($(RELEASE_KIND), dev)
35+
@echo "Error! Must be on the $(PRIMARY_BRANCH_NAME) branch to bump $(RELEASE_KIND)."
36+
exit
37+
endif
38+
39+
git fetch -p --all
40+
generate-changelog
41+
$(call EDIT_CHANGELOG)
42+
export BRANCH_NAME=$(SHORT_BRANCH_NAME);bumpversion $(BUMPVERSION_OPTS) $(RELEASE_KIND) --allow-dirty
43+
#git push origin $(BRANCH_NAME)
44+
#git push --tags
45+
46+
set-release-kind-major:
47+
$(eval RELEASE_KIND := major)
48+
49+
set-release-kind-minor:
50+
$(eval RELEASE_KIND := minor)
51+
52+
set-release-kind-patch:
53+
$(eval RELEASE_KIND := patch)
54+
55+
set-release-kind-dev:
56+
$(eval RELEASE_KIND := dev)
57+
58+
get-version: # Sets the value after release-version to the VERSION
59+
$(eval VERSION := $(filter-out release-version,$(MAKECMDGOALS)))
60+
$(eval BUMPVERSION_OPTS := --new-version=$(VERSION))
61+
62+
%: # NO-OP for unrecognized rules
63+
@:

0 commit comments

Comments
 (0)