File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 4242 id : version
4343 if : ${{ ! env.CI_SKIP }}
4444 run : |
45- echo "current version: "$(git tag --sort=committerdate | tail -1 )
45+ echo "recent version tags : "$(git tag --sort=committerdate | tail -4 )
4646 NEXT=$(python autotick-bot/compute_next_version.py)
4747 echo "next version: ${NEXT}"
4848 echo "NEXT=${NEXT}" >> "$GITHUB_OUTPUT"
Original file line number Diff line number Diff line change 22import subprocess
33import sys
44
5+ from conda .models .version import VersionOrder
6+
57# get the current date for tagging below
68now = datetime .datetime .utcnow ()
79
1820else :
1921 # we have a tag so bump
2022 curr_version = None
23+ curr_version_line = None
2124 for line in res .stdout .splitlines ():
2225 line = line .strip ()
2326 if line :
24- curr_version = line
27+ try :
28+ _version = VersionOrder (line )
29+ except Exception :
30+ print (
31+ f"skipping tag that is not a version: { line } " ,
32+ file = sys .stderr ,
33+ flush = True ,
34+ )
35+ continue
36+
37+ if curr_version is None or _version > curr_version :
38+ curr_version = _version
39+ curr_version_line = line
2540 assert curr_version is not None
26- print ("found current version: %s" % line , file = sys .stderr , flush = True )
41+ print (f "found current version: { curr_version_line } " , file = sys .stderr , flush = True )
2742
2843 # figure out if we bump the major, minor or patch version
29- major_minor , patch = curr_version .rsplit ("." , 1 )
44+ major_minor , patch = curr_version_line .rsplit ("." , 1 )
3045 now_major_minor = f"{ now .year } .{ now .month } "
3146 if major_minor == now_major_minor :
3247 new_version = f"{ major_minor } .{ int (patch ) + 1 } "
You can’t perform that action at this time.
0 commit comments