Skip to content

Commit 17df351

Browse files
authored
Adjust a release process: remove additional sembump dependency; updat… (#395)
* Adjust a release process: remove additional sembump dependency; update release documentation with example, make it a bit shorter * update the doc to make linter happy * update contributing to fix linter
1 parent adb21dd commit 17df351

File tree

3 files changed

+34
-27
lines changed

3 files changed

+34
-27
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,28 @@ number vor the tag.
9494
9595
*Before pushing a tag*, the pyproject version needs to be bumped.
9696
97-
1. Run `make changes` to review the merged PRs since last release.
97+
1. Run `make changes` to review the merged PRs since last release and decide what kind of release you are doing (bugfix, feature or breaking).
9898
* Review the tags on each PR and make sure they are categorized
9999
appropriately.
100-
2. Determine the bump type (major, minor, patch).
101-
3. Run `BUMP=(bugfix|feature|breaking) make bump_version` to update the `pydo`
100+
101+
1. Run `BUMP=(bugfix|feature|breaking) make bump_version` to update the `pydo`
102102
version.
103103
* `BUMP` also accepts `(patch|minor|major)`
104-
4. Run `make generate` to update the version in the codebase.
105-
5. Make a pull request with this change. It should be separate from PRs
106-
containing changes to the library (including regenerated code).
107-
6. *Once the version bump PR has been pushed and merged*, tag the commit to trigger the
108-
release workflow.
109-
Run `make tag` to tag the latest commit and push the tag to ORIGIN.
104+
105+
Command example:
106+
107+
```code
108+
make BUMP=minor bump_version
109+
```
110+
111+
1. Run `make generate` to update the version in the codebase. Make a pull request with this change.
112+
It should be separate from PRs containing changes to the library (including regenerated code).
113+
1. Once the version bump PR has been pushed and merged, tag the commit to trigger the
114+
release workflow: run `make tag` to tag the latest commit and push the tag to ORIGIN.
115+
116+
Notes:
110117
* To tag an earlier commit, run `COMMIT=${commit} make tag`.
111118
* To push the tag to a different remote, run `ORIGIN=${REMOTE} make tag`.
112-
7. Once the release process completes, review the draft release for correctness
113-
and publish the release. Also, ensure the release has been marked `Latest`.
119+
1. Once the release process completes, review the draft release for correctness and publish the release.
120+
121+
Ensure the release has been marked `Latest`.

Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,8 @@ changes: _install_github_release_notes
114114
version:
115115
@poetry version
116116

117-
.PHONY: _install_sembump
118-
_install_sembump:
119-
@echo "=> installing/updating sembump tool"
120-
@echo ""
121-
@GO111MODULE=off go get -u github.com/jessfraz/junk/sembump
122-
123117
.PHONY: bump_version
124-
bump_version: _install_sembump ## Bumps the version
118+
bump_version: ## Bumps the version
125119
@echo "==> BUMP=${BUMP} bump_version"
126120
@echo ""
127121
@ORIGIN=${ORIGIN} scripts/bumpversion.sh
@@ -130,4 +124,4 @@ bump_version: _install_sembump ## Bumps the version
130124
tag: ## Tags a release
131125
@echo "==> ORIGIN=${ORIGIN} COMMIT=${COMMIT} tag"
132126
@echo ""
133-
@ORIGIN=${ORIGIN} scripts/tag.sh
127+
@ORIGIN=${ORIGIN} scripts/tag.sh

scripts/bumpversion.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@ ORIGIN=${ORIGIN:-origin}
77
# Bump defaults to patch. We provide friendly aliases
88
# for patch, minor and major
99
BUMP=${BUMP:-patch}
10+
11+
poetry_version=$(poetry version)
12+
version="${poetry_version:5}"
13+
IFS='.' read -r major minor patch <<< "$version"
14+
1015
case "$BUMP" in
1116
feature | minor)
12-
BUMP="minor"
17+
minor=$((minor + 1))
18+
patch=0
1319
;;
1420
breaking | major)
15-
BUMP="major"
21+
major=$((major + 1))
22+
minor=0
23+
patch=0
1624
;;
1725
*)
18-
BUMP="patch"
26+
patch=$((patch + 1))
1927
;;
2028
esac
2129

@@ -27,10 +35,7 @@ elif [[ $(git status --porcelain -b | grep -e "ahead" -e "behind") != "" ]]; the
2735
exit 1
2836
fi
2937

30-
poetry_version=$(poetry version)
31-
version="${poetry_version:5}"
32-
new_version="$(sembump --kind "$BUMP" "$version")"
33-
38+
new_version="$major.$minor.$patch"
3439
poetry version "${new_version#v}"
3540

36-
echo ""
41+
echo ""

0 commit comments

Comments
 (0)