This repository was archived by the owner on May 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.lua
More file actions
66 lines (51 loc) · 2.09 KB
/
main.lua
File metadata and controls
66 lines (51 loc) · 2.09 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---@class Darwin
darwin = darwin
function main()
local first_action = darwin.argv.get_next_unused()
if first_action == "test_container" then
local container_name = darwin.argv.get_next_unused()
if container_name == nil then
print("Please provide a container name")
return
end
os.execute("mkdir -p release")
local image = darwin.ship.create_machine(container_name .. ":latest")
image.provider = CONTANIZER
image.start({
flags = { "-it" },
volumes = {
{ "./release", "/release" },
},
})
return
end
local encrypt_key = darwin.argv.get_flag_arg_by_index({ "encrypt_key"}, 1)
if not encrypt_key then
print("Please provide an encrypt_key")
return
end
darwin.silverchain.remove("src")
create_encrypt_key(encrypt_key)
Install_dependencies()
create_assets()
silver_chain_organize()
local build_funcs = create_build_funcs()
darwin.dtw.remove_any("release")
darwin.dtw.remove_any(".cache")
local i = 1
for name, buld_lambda in pairs(build_funcs) do
if darwin.argv.one_of_args_exist(name) then
print("\n=========================================================================================")
print("\tstarted of build:", i, "\n")
buld_lambda()
print("\n\tA build [" .. i .. "] finished")
print("=========================================================================================\n\n")
i = i + 1
end
end
darwin.dtw.move_any_overwriting("release/alpine_static_bin.out","release/"..PROJECT_NAME..".out")
darwin.dtw.move_any_overwriting("release/windows64.exe","release/"..PROJECT_NAME.."64.exe")
darwin.dtw.move_any_overwriting("release/windowsi32.exe","release/"..PROJECT_NAME.."i32.exe")
darwin.dtw.move_any_overwriting("release/debian_static.deb","release/"..PROJECT_NAME..".deb")
darwin.dtw.move_any_overwriting("release/rpm_static_build.rpm","release/"..PROJECT_NAME..".rpm")
end