Skip to content

Commit

Permalink
workflows: Fix version check for X.0.0 releases
Browse files Browse the repository at this point in the history
  • Loading branch information
tstellar committed Jul 27, 2022
1 parent 2cfcbe2 commit 51ba98d
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/version-check.py
Expand Up @@ -10,13 +10,21 @@

tag = repo.git.describe(tags = True, abbrev=0)
m = re.match('llvmorg-([0-9]+)\.([0-9]+)\.([0-9]+)', tag)
if not m:
print("error: Tag is not valid: ", tag)
sys.exit(1)

expected_major = m.group(1)
expected_minor = m.group(2)
expected_patch = int(m.group(3)) + 1
if m:
expected_major = m.group(1)
expected_minor = m.group(2)
expected_patch = int(m.group(3)) + 1
else:
# If the previous tag is llvmorg-X-init, then we should be at version X.0.0.
m = re.match('llvmorg-([0-9]+)-init', tag)
if not m:
print("error: Tag is not valid: ", tag)
sys.exit(1)
expected_major = m.group(1)
expected_minor = 0
expected_patch = 0

expected_version = f"{expected_major}.{expected_minor}.{expected_patch}"

m = re.match("[0-9]+\.[0-9]+\.[0-9]+", version)
Expand Down

0 comments on commit 51ba98d

Please sign in to comment.