File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,26 @@ def get_release_info():
150
150
}
151
151
152
152
153
- if __name__ == "__main__" :
153
+ def get_compare_url (tag_name ):
154
+ """
155
+ Get the URL to the GitHub compare page for the latest release compared
156
+ to current main.
157
+ """
158
+ remote_url = subprocess .getoutput ("git ls-remote --get-url origin" )
159
+ if not remote_url .startswith ("https" ):
160
+ remote_url = subprocess .getoutput ("git ls-remote --get-url adafruit" )
161
+
162
+ if not remote_url .startswith ("https" ):
163
+ return "Sorry, Unknown Remotes"
164
+
165
+ compare_url = remote_url .replace (".git" , f"/compare/{ tag_name } ...main" )
166
+ return compare_url
167
+
168
+
169
+ def main_cli ():
170
+ """
171
+ Main CLI entry point
172
+ """
154
173
logging .basicConfig (
155
174
level = logging .INFO ,
156
175
format = "%(asctime)s [%(levelname)s] %(message)s" ,
@@ -167,6 +186,7 @@ def menu_prompt(release_info):
167
186
Returns the choice inputted by the user.
168
187
"""
169
188
print ("This library needs a new release. Please select a choice:" )
189
+ print (f"Changes: { get_compare_url (release_info ['current_tag' ])} " )
170
190
print (
171
191
f"1. *default* Bump Patch, new tag would be: { release_info ['new_tag_patch' ]} "
172
192
)
@@ -210,3 +230,7 @@ def menu_prompt(release_info):
210
230
211
231
else :
212
232
logging .info ("No new commits since last release, skipping" )
233
+
234
+
235
+ if __name__ == "__main__" :
236
+ main_cli ()
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ classifiers = [
35
35
]
36
36
dynamic = [" dependencies" , " optional-dependencies" ]
37
37
38
+ [project .scripts ]
39
+ adabot-release = " adabot.circuitpython_library_release:main_cli"
40
+
38
41
[tool .setuptools ]
39
42
packages = [" adabot" ]
40
43
You can’t perform that action at this time.
0 commit comments