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

Add support for minor release #256

Merged
merged 2 commits into from
Feb 12, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:

docs:
runs-on: ubuntu-20.04
timeout-minutes: 5
timeout-minutes: 10
defaults:
run:
shell: bash -l {0}
Expand Down
3 changes: 2 additions & 1 deletion docs/source/get_started/making_first_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ already uses Jupyter Releaser.
![Draft Changelog Workflow Dialog](../images/draft_changelog.png)

- The "New Version Spec" will usually be the full version (e.g. 0.7.1). Repos using `tbump` can also use the "next"
option, which will bump the micro version (or the build version in the case of a prerelease).
option, which will bump the micro version (or the build version in the case of a prerelease). The "minor" option allows projects using "tbump" to bump
to the next minor version directly.
- Use the "since" field to select PRs prior to the latest tag to include in the release
- Type "true" in the "since the last stable git tag" if you would like to include PRs since the last non-prerelease version tagged on the target repository and branch.
- The workflow will use the GitHub API to find the relevant pull requests and make an appropriate changelog entry.
Expand Down
4 changes: 3 additions & 1 deletion jupyter_releaser/tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ def test_bump_version(py_package):
assert util.get_version() == "1.0.3a6"
util.bump_version("1.0.3.dev1")
util.bump_version("next")
assert util.get_version() == "1.0.3.dev2"
assert util.get_version() == "1.0.3"
util.bump_version("minor")
assert util.get_version() == "1.1.0"


def test_get_config_python(py_package):
Expand Down
4 changes: 3 additions & 1 deletion jupyter_releaser/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,15 @@ def bump_version(version_spec, version_cmd=""):
v = parse_version(get_version())
if version_spec == "next":
if v.is_devrelease:
version_spec = f"{v.major}.{v.minor}.{v.micro}.dev{v.dev + 1}"
version_spec = f"{v.major}.{v.minor}.{v.micro}"
elif v.is_prerelease:
version_spec = f"{v.major}.{v.minor}.{v.micro}{v.pre[0]}{v.pre[1] + 1}"
else:
version_spec = f"{v.major}.{v.minor}.{v.micro + 1}"
elif version_spec == "patch":
version_spec = f"{v.major}.{v.minor}.{v.micro + 1}"
elif version_spec == "minor":
version_spec = f"{v.major}.{v.minor + 1}.0"

# Bump the version
run(f"{version_cmd} {version_spec}")
Expand Down