File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 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
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 :
You can’t perform that action at this time.
0 commit comments