@@ -20,7 +20,7 @@ def tag(version, dryrun=False, kind=None):
20
20
print ("Would tag: {}" .format (tag ))
21
21
else :
22
22
subprocess .run (['git' , 'tag' , tag ])
23
- subprocess .run (['git' , 'push' , 'origin ' , tag ])
23
+ subprocess .run (['git' , 'push' , 'upstream ' , tag ])
24
24
25
25
def pypi (wheel = True , test = False ):
26
26
"""release on pypi
@@ -51,11 +51,18 @@ def npmjs(dryrun=False):
51
51
52
52
def labExtensionVersion (dryrun = False , version = None ):
53
53
if version :
54
+ if 'rc' in version :
55
+ version ,rc = version .split ('rc' )
56
+ version = version + '-rc.{}' .format (rc )
57
+
54
58
force_ver_cmd = ['npm' , '--no-git-tag-version' , 'version' , version , '--force' , '--allow-same-version' ]
59
+ force_ver_info = ' ' .join (force_ver_cmd )
60
+
55
61
if dryrun :
56
- print ("Would force npm version with: {}" .format (' ' . join ( force_ver_cmd ) ))
62
+ print ("Would force npm version with: {}" .format (force_ver_info ))
57
63
else :
58
64
# force the labextension version to match the supplied version
65
+ print ("> {}" .format (force_ver_info ))
59
66
subprocess .run (force_ver_cmd )
60
67
else :
61
68
# get single source of truth from the Typescript labextension
@@ -71,17 +78,17 @@ def serverExtensionVersion():
71
78
return get_version (VERSION_PY )
72
79
73
80
def doRelease (test = False ):
74
- # prep the build area for the labextension bundle
75
- prepLabextensionBundle ()
76
-
77
81
# treat the serverextension version as the "real" single source of truth
78
82
version = serverExtensionVersion ()
79
83
# force the labextension version to agree with the serverextension version
80
- labExtensionVersion (dryrun = test , version = version )
84
+ labExtensionVersion (version = version )
81
85
82
86
# tag with version and push the tag
83
87
tag (dryrun = test , version = version )
84
88
89
+ # prep the build area for the labextension bundle
90
+ prepLabextensionBundle ()
91
+
85
92
# release to pypi and npmjs
86
93
pypi (test = test )
87
94
npmjs (dryrun = test )
0 commit comments