update relaese script

This commit is contained in:
Gabor Kiss-Vamosi
2020-07-07 10:00:38 +02:00
parent e30efb716f
commit a117b3cead

28
scripts/release.py Normal file → Executable file
View File

@@ -1,3 +1,5 @@
#!/usr/bin/env python
import re
import os
lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+')
@@ -13,8 +15,7 @@ def cmd(c):
print("\n" + c)
r = os.system(c)
if r:
print("Exit due to previous error")
exit(r)
print("### Error: " + str(r))
def lvgl_clone():
title("lvgl: Clone")
@@ -26,7 +27,7 @@ def lvgl_format():
title("lvgl: Run code formatter")
os.chdir("./scripts")
cmd("./code-format.sh")
cmd("git ci -am 'Run code formatter'")
os.system("git ci -am 'Run code formatter'")
os.chdir("..")
def lvgl_update_version():
@@ -104,7 +105,7 @@ def lvgl_update_lv_conf_templ(ver_str):
def lvgl_commit_push(v):
title("lvgl: commit and push release")
cmd('git ci -am "Release ' + v + '"')
os.system('git ci -am "Release ' + v + '"')
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
cmd('git push origin master')
cmd('git push origin ' + v)
@@ -133,7 +134,7 @@ def examples_clone():
def examples_commit_push(v):
title("examples: commit and push release")
cmd('git ci -am "Release ' + v + '"')
os.system('git ci -am "Release ' + v + '"')
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
cmd('git push origin master')
cmd('git push origin ' + v)
@@ -156,7 +157,7 @@ def drivers_clone():
def drivers_commit_push(v):
title("drivers: commit and push release")
cmd('git ci -am "Release ' + v + '"')
os.system('git ci -am "Release ' + v + '"')
cmd('git tag -a ' + v + ' -m "Release ' + v +'"')
cmd('git push origin master')
cmd('git push origin ' + v)
@@ -170,15 +171,15 @@ def drivers_merge_to_release_branch(v):
def docs_clone():
title("docs: Clone")
cmd("git clone --recursive https://github.com/lvgl/docs.git")
#cmd("git clone --recursive https://github.com/lvgl/docs.git")
os.chdir("./docs")
def docs_get_api():
title("docs: Get API files")
cmd("git co latest")
cmd("git co latest --")
cmd("rm -rf xml");
cmd("cp -r ../../lvgl/docs/api_doc/xml .");
cmd("cp -r ../lvgl/docs/api_doc/xml .");
cmd("git add xml");
cmd('git commit -m "update API"')
@@ -207,11 +208,7 @@ def docs_update_version(v):
f.write(outbuf)
f.close()
cmd("git add conf.py")
cmd('git ci -m "update conf.py to ' + v '"')
def docs_update_trans():
title("docs: Update translations")
cmd("cd en && ./trans_push.py && ./trans_pull.py")
cmd('git ci -m "update conf.py to ' + v + '"')
def docs_build():
title("docs: Build")
@@ -220,7 +217,7 @@ def docs_build():
def clean_up():
title("Clean up repos")
os.chdir("../..")
os.chdir("../")
cmd("rm -rf lvgl docs lv_examples lv_drivers")
lvgl_clone()
@@ -243,7 +240,6 @@ drivers_merge_to_release_branch(ver_str)
docs_clone()
docs_get_api()
docs_update_version(ver_str)
#docs_update_trans() # Zanata is not working now
docs_build()
clean_up()