add CI for android (test)

This commit is contained in:
flaribbit
2021-05-28 23:33:50 +08:00
parent cf49685406
commit ae03346bb7
2 changed files with 27 additions and 24 deletions

12
.github/workflows/updateVersion.py vendored Normal file
View File

@@ -0,0 +1,12 @@
import re
with open("conf.lua", "r") as file:
data = file.read()
versionCode = re.search("build=(\\d+)", data).group(1)
versionName = re.search('short="([^"]+)', data).group(1)
with open("apk/apktool.yml", "r+") as file:
data = file.read()
data = re.sub("versionCode:.+", f"versionCode: '{versionCode}'", data)
data = re.sub("versionName:.+", f"versionName: {versionName}", data)
file.seek(0)
file.truncate()
file.write(data)