1-
21import argparse
32import logging
43import os
109logging .basicConfig (encoding = "utf-8" , level = logging .INFO )
1110
1211parser = argparse .ArgumentParser ("release" )
13- parser .add_argument ("branch_client_python" , help = "The new version number of the release." , type = str )
14- parser .add_argument ("previous_version" , help = "The previous version number of the release." , type = str )
15- parser .add_argument ("new_version" , help = "The new version number of the release." , type = str )
16- parser .add_argument ("--dev" , help = "Flag to prevent pushing the release." , action = "store_false" )
12+ parser .add_argument (
13+ "branch_client_python" , help = "The new version number of the release." , type = str
14+ )
15+ parser .add_argument (
16+ "previous_version" , help = "The previous version number of the release." , type = str
17+ )
18+ parser .add_argument (
19+ "new_version" , help = "The new version number of the release." , type = str
20+ )
21+ parser .add_argument (
22+ "--dev" , help = "Flag to prevent pushing the release." , action = "store_false"
23+ )
1724args = parser .parse_args ()
1825
1926previous_version = args .previous_version
4350
4451# Commit the change
4552logging .info ("[client-python] Pushing to " + branch_client_python )
46- os .system (
47- 'git commit -a -m "[client] Release '
48- + new_version
49- + '" > /dev/null 2>&1' )
50- if not args .dev :
51- os .system ('git push origin '
52- + branch_client_python
53- + " > /dev/null 2>&1"
54- )
53+ os .system ('git commit -a -m "[client] Release ' + new_version + '" > /dev/null 2>&1' )
54+ if not args .dev :
55+ os .system ("git push origin " + branch_client_python + " > /dev/null 2>&1" )
5556
5657logging .info ("[client-python] Tagging" )
57- os .system (
58- "git tag -f "
59- + new_version
60- )
61- if not args .dev :
62- os .system (
63- "git push -f --tags > /dev/null 2>&1"
64- )
58+ os .system ("git tag -f " + new_version )
59+ if not args .dev :
60+ os .system ("git push -f --tags > /dev/null 2>&1" )
6561
6662logging .info ("[client-python] Generating release" )
6763os .system ("gren release > /dev/null 2>&1" )
8076release_body = release_data ["body" ]
8177
8278logging .info ("[client-python] Generating the new release note" )
83- if not args .dev :
79+ if not args .dev :
8480 github_release_note = requests .post (
8581 "https://api.github.com/repos/OpenBAS-Platform/client-python/releases/generate-notes" ,
8682 headers = {
115111 json = {"body" : new_release_note },
116112 )
117113
118- if not args .dev :
119- closeRelease ("https://api.github.com/repos/OpenBAS-Platform/client-python" , new_version , github_token )
114+ if not args .dev :
115+ closeRelease (
116+ "https://api.github.com/repos/OpenBAS-Platform/client-python" ,
117+ new_version ,
118+ github_token ,
119+ )
120120
121121logging .info (
122122 "[client-python] Release done! Waiting 10 minutes for CI/CD and publication..."
123123)
124124
125- if not args .dev :
126- time .sleep (600 )
125+ if not args .dev :
126+ time .sleep (600 )
0 commit comments