@@ -116,14 +116,16 @@ def create_github_release(access_token, tag_name, release_notes, release_path):
116116def main ():
117117 parser = argparse .ArgumentParser ()
118118 parser .add_argument ('tag' , type = str , help = 'new release TAG' )
119+ parser .add_argument ('-l' , '--local' , help = 'Run local, without uploading to github' , action = "store_true" )
119120 option = parser .parse_args ()
120121
122+ is_local = option .local
121123 CREDENTIALS = read_credentials () or None
122124 repo = Repo (".." )
123125 new_version = float (option .tag )
124126 last_version = float (str (repo .tags [- 1 ]))
125127
126- if CREDENTIALS is None :
128+ if CREDENTIALS is None and not is_local :
127129 print ("Missing credentials.json file" )
128130 print ("""
129131Credentials file should be in the following format:
@@ -167,20 +169,21 @@ def main():
167169 print ("committing and pushing changes..." )
168170 commit_version_change (repo , new_version )
169171 repo .create_tag (new_version )
170- push_changes (repo , new_version )
171172
172173 build_release (make_jar = True )
173174 release_path = glob .glob ("../build/libs/*" )[0 ]
174175
175- print ("Creating new relese on github (this can take a while)..." )
176- try :
177- release_url = create_github_release (
178- CREDENTIALS ["github_access_token" ], new_version , release_notes , release_path )
179- print (f"Release { new_version } successfully created: { release_url } " )
180- except Exception as e :
181- print ("Failed to create or upload github release. Try manually" )
182- print (e )
183- exit (1 )
176+ if not is_local :
177+ print ("Creating new relese on github (this can take a while)..." )
178+ push_changes (repo , new_version )
179+ try :
180+ release_url = create_github_release (
181+ CREDENTIALS ["github_access_token" ], new_version , release_notes , release_path )
182+ print (f"Release { new_version } successfully created: { release_url } " )
183+ except Exception as e :
184+ print ("Failed to create or upload github release. Try manually" )
185+ print (e )
186+ exit (1 )
184187
185188
186189if __name__ == "__main__" :
0 commit comments