forked from sockeye-d/godl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_linux.nu
More file actions
executable file
·39 lines (28 loc) · 1.11 KB
/
Copy pathdeploy_linux.nu
File metadata and controls
executable file
·39 lines (28 loc) · 1.11 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
def main [release_cycle: string = "stable", zip_dir: string = "deploy"] {
if (which 7z | is-empty) {
print "Couldn't find 7-zip"
exit 1
}
let current_dir: string = pwd
let build_dir: string = ls build/* | sort-by modified | last | get name | path expand
print $"Assuming build directory is ($build_dir)"
if ((input -d Y "Is this okay? [Y/n] " | str downcase) == "n") {
exit 1
}
let deploy_dir = $"($build_dir)\\deploy"
print $"Zipping files in ($deploy_dir)"
let zip_name: string = $zip_dir | path join $"godl-(git describe --tags --abbrev=0)-($release_cycle)-linux.zip"
print $zip_name
let files = glob $"($deploy_dir | str replace --all '\' '/')/*"
7z a $zip_name ...$files
if ((input -d N "Upload to GitHub? [y/N] " | str downcase) == "y") {
if (which 7z | is-empty) {
print "Couldn't find gh CLI"
exit 1
}
gh release upload (git describe --tags --abbrev=0) $zip_name --clobber
if ((input -d N "Remove zip file? [y/N] " | str downcase) == "y") {
rm $zip_name
}
}
}