Skip to content
Merged
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
11 changes: 7 additions & 4 deletions .github/scripts/resolve-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
import re
import sys

# what app/build.gradle accepts: an optional v, one to three parts, each below
# 100 so that two digits per part stays unambiguous
VERSION = re.compile(r"^v?[0-9]{1,2}(\.[0-9]{1,2}){0,2}$")
# what app/build.gradle accepts: an optional v, all three parts, each below 100 so
# that two digits per part stays unambiguous. Two-part versions were once padded
# with a zero, which let one build be tagged under two names; the build refuses
# them now, and this has to refuse the same ones or it stops being a check
VERSION = re.compile(r"^v?[0-9]{1,2}(\.[0-9]{1,2}){2}$")


def fail(message):
Expand Down Expand Up @@ -70,7 +72,8 @@ def resolve(tag, given, uploads, log=print):

if not VERSION.match(version):
raise ValueError(
f"'{version}' is not a version: expected something like v4.8.0, each part below 100"
f"'{version}' is not a version: expected something like v4.8.0 - all "
"three parts, each below 100"
)
log(f"building {version}")
return version
Expand Down
Loading