更新ci以适配新的版本信息文件 (#214)
* 修改updateConfVersion.py * 添加更新conf.lua时修改存档目录的步骤 * Add files via upload * 更改ci脚本以适配新版版本信息 * 修正问题 * 打包时添加version.lua * 更新updateVersion.py以适配新版版本信息 * 删除被替换的py文件 Co-authored-by: MrZ_26 <1046101471@qq.com>
This commit is contained in:
13
.github/workflows/updateConfVersion.py
vendored
13
.github/workflows/updateConfVersion.py
vendored
@@ -1,14 +1,23 @@
|
||||
import argparse
|
||||
|
||||
def updateConf():
|
||||
with open("conf.lua", "r+", encoding="utf-8") as file:
|
||||
data = file.read()
|
||||
data = data.replace("t.identity='Techmino'--Saving folder", "t.identity='Techmino_Snapshot'--Saving folder")
|
||||
file.seek(0)
|
||||
file.truncate()
|
||||
file.flush()
|
||||
file.write(data)
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="用于更新conf.lua")
|
||||
parser.add_argument("-H", "--Hash", type=str, default = False, help = "Github提交Hash")
|
||||
args = parser.parse_args()
|
||||
with open("conf.lua", "r+", encoding="utf-8") as file:
|
||||
with open("version.lua", "r+", encoding="utf-8") as file:
|
||||
data = file.read()
|
||||
if args.Hash != False:
|
||||
data = data.replace('@DEV', f'@{args.Hash[0:4]}')
|
||||
data = data.replace("t.identity='Techmino'--Saving folder", "t.identity='Techmino_Snapshot'--Saving folder")
|
||||
updateConf()
|
||||
else:
|
||||
data = data.replace('@DEV', '')
|
||||
file.seek(0)
|
||||
|
||||
Reference in New Issue
Block a user