File tree 2 files changed +19
-4
lines changed
2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 42
42
id : version
43
43
if : ${{ ! env.CI_SKIP }}
44
44
run : |
45
- echo "current version: "$(git tag --sort=committerdate | tail -1 )
45
+ echo "recent version tags : "$(git tag --sort=committerdate | tail -4 )
46
46
NEXT=$(python autotick-bot/compute_next_version.py)
47
47
echo "next version: ${NEXT}"
48
48
echo "NEXT=${NEXT}" >> "$GITHUB_OUTPUT"
Original file line number Diff line number Diff line change 2
2
import subprocess
3
3
import sys
4
4
5
+ from conda .models .version import VersionOrder
6
+
5
7
# get the current date for tagging below
6
8
now = datetime .datetime .utcnow ()
7
9
18
20
else :
19
21
# we have a tag so bump
20
22
curr_version = None
23
+ curr_version_line = None
21
24
for line in res .stdout .splitlines ():
22
25
line = line .strip ()
23
26
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
25
40
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 )
27
42
28
43
# 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 )
30
45
now_major_minor = f"{ now .year } .{ now .month } "
31
46
if major_minor == now_major_minor :
32
47
new_version = f"{ major_minor } .{ int (patch ) + 1 } "
You can’t perform that action at this time.
0 commit comments