File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
.github/actions/check-release Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,10 @@ runs:
19
19
# Set up env variables
20
20
export GITHUB_ACCESS_TOKEN=${{ inputs.token }}
21
21
export RH_REPOSITORY=${GITHUB_REPOSITORY}
22
- export RH_VERSION_SPEC=0.0.1a0
23
- export RH_POST_VERSION_SPEC=0.1.0.dev0
24
22
export RH_CHANGELOG=${{ inputs.changelog }}
25
23
export RH_DRY_RUN=true
26
24
export RH_REF=${GITHUB_REF}
27
25
28
- # check for npm-only package
29
- if [[ ! -f setup.py && -f package.json ]]; then
30
- export RH_VERSION_SPEC=patch
31
- export RH_POST_VERSION_SPEC=
32
- fi
33
-
34
26
if [ ! -z ${GITHUB_BASE_REF} ]; then
35
27
echo "Using GITHUB_BASE_REF: ${GITHUB_BASE_REF}"
36
28
export RH_BRANCH=${GITHUB_BASE_REF}
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ def main():
114
114
click .option (
115
115
"--version-spec" ,
116
116
envvar = "RH_VERSION_SPEC" ,
117
- required = True ,
117
+ default = "" ,
118
118
help = "The new version specifier" ,
119
119
)
120
120
]
Original file line number Diff line number Diff line change 17
17
from subprocess import PIPE
18
18
19
19
import toml
20
+ from pkg_resources import parse_version
20
21
21
22
PYPROJECT = Path ("pyproject.toml" )
22
23
SETUP_PY = Path ("setup.py" )
@@ -176,6 +177,14 @@ def bump_version(version_spec, version_cmd=""):
176
177
if not version_cmd : # pragma: no cover
177
178
raise ValueError ("Please specify a version bump command to run" )
178
179
180
+ # Assign default values if not version spec was given
181
+ if not version_spec :
182
+ if "tbump" in version_cmd :
183
+ version = parse_version (get_version ())
184
+ version_spec = f"{ version .major } .{ version .minor } .{ version .micro + 1 } "
185
+ else :
186
+ version_spec == "patch"
187
+
179
188
# Bump the version
180
189
run (f"{ version_cmd } { version_spec } " )
181
190
You can’t perform that action at this time.
0 commit comments