build scripts & issue templates

This commit is contained in:
nyne
2024-10-27 20:16:04 +08:00
parent 8b95442dad
commit 3cea340f97
14 changed files with 437 additions and 2 deletions

32
windows/build.py Normal file
View File

@@ -0,0 +1,32 @@
import subprocess
import os
file = open('pubspec.yaml', 'r')
content = file.read()
file.close()
subprocess.run(["flutter", "build", "windows"], shell=True)
if os.path.exists("build/app-windows.zip"):
os.remove("build/app-windows.zip")
version = str.split(str.split(content, 'version: ')[1], '+')[0]
subprocess.run(["tar", "-a", "-c", "-f", f"build/windows/Venera-{version}-windows.zip", "-C", "build/windows/x64/runner/Release", "."]
, shell=True)
issContent = ""
file = open('windows/build.iss', 'r')
issContent = file.read()
newContent = issContent
newContent = newContent.replace("{{version}}", version)
newContent = newContent.replace("{{root_path}}", os.getcwd())
file.close()
file = open('windows/build.iss', 'w')
file.write(newContent)
file.close()
subprocess.run(["iscc", "windows/build.iss"], shell=True)
with open('windows/build.iss', 'w') as file:
file.write(issContent)