2022-05-29 10:14:22 +08:00
|
|
|
#!/usr/bin/python3
|
|
|
|
import os
|
|
|
|
|
2022-06-09 18:07:15 +08:00
|
|
|
def get_version():
|
|
|
|
with open("Cargo.toml") as fh:
|
|
|
|
for line in fh:
|
|
|
|
if line.startswith("version"):
|
|
|
|
return line.replace("version", "").replace("=", "").replace('"', '').strip()
|
|
|
|
return ''
|
|
|
|
|
2022-05-29 10:14:22 +08:00
|
|
|
if __name__ == '__main__':
|
2022-06-09 18:07:15 +08:00
|
|
|
# check version
|
|
|
|
version = get_version()
|
2022-06-09 17:30:26 +08:00
|
|
|
os.chdir("appimage")
|
2022-06-09 18:07:15 +08:00
|
|
|
os.system("sed -i 's/^Version=.*/Version=%s/g' rustdesk.desktop" % version)
|
|
|
|
# build appimage
|
2022-06-09 17:30:26 +08:00
|
|
|
ret = os.system("appimage-builder --recipe AppImageBuilder.yml --skip-test")
|
|
|
|
if ret == 0:
|
|
|
|
print("RustDesk AppImage build success :)")
|
|
|
|
print("Check AppImage in '/path/to/rustdesk/appimage/RustDesk-VERSION-TARGET_PLATFORM.AppImage'")
|
|
|
|
else:
|
|
|
|
print("RustDesk AppImage build failed :(")
|