Skip to content

Commit cece501

Browse files
committed
Check version: More explicit error message
1 parent d4f3ac3 commit cece501

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/wheel-releaser.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ jobs:
2929
name: 'Check version compliance'
3030
runs-on: ubuntu-latest
3131
steps:
32-
- if: ${{ inputs.release-version != '' }}
32+
- name: Check version compliance
33+
if: ${{ inputs.release-version != '' }}
3334
shell: python
3435
run: |
3536
import sys
@@ -38,9 +39,16 @@ jobs:
3839
semver_regex = r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
3940
res = re.fullmatch(semver_regex, version)
4041
if res:
41-
print("Version number OK ('{version}')")
42+
print("::notice::Version number OK ('{version}')")
4243
else:
43-
print(f"::error::Invalid version number '{version}' - (see https://semver.org)")
44+
message = [
45+
f"::error::INVALID RELEASE VERSION NUMBER '{version}'",
46+
"Version must comply to Semantic Versioning standard:",
47+
"\n\tmajor.minor.patch[-pre]\n",
48+
"See https://semver.org for more information",
49+
"or leave the field blank for default value\n"
50+
]
51+
print("\n".join(message))
4452
sys.exit(1)
4553
4654
call-build-wheels:

0 commit comments

Comments
 (0)