-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_platform.py
47 lines (33 loc) · 1.13 KB
/
build_platform.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Creates a build on a specific platform.
import os
import sys
import shutil
print("Building application")
os.system("cargo build --release")
os.system("cargo build --release --package updater")
platform = ""
if sys.platform == "win32":
platform = "win"
elif sys.platform == "linux":
platform = "linux"
os.mkdir("temp")
print("Copying files to temp directory")
shutil.copytree("assets", "temp/assets")
shutil.copy("CONTRIBUTING.md", "temp/CONTRIBUTING.md")
shutil.copy("LICENSE", "temp/LICENSE")
shutil.copy("README.md", "temp/README.md")
shutil.copy("logging_config.yaml", "temp/logging_config.yaml")
shutil.copy("VERSION", "temp/VERSION")
shutil.copy("update_log.md", "temp/update_log.md")
shutil.copy(".gitignore", "temp/.gitignore")
if platform == "win":
shutil.copy("target/release/wavey.exe", "temp/wavey.exe")
shutil.copy("target/release/updater.exe", "temp/updater.exe")
else:
shutil.copy("target/release/wavey", "temp/wavey")
shutil.copy("target/release/updater", "temp/updater")
print("Compressing files")
os.system(f"7z a update-package-{platform} temp/*")
print("Cleaning up")
shutil.rmtree("temp")
print("Done")