build: bundle deno executable

main
spacemeowx2 2023-03-03 21:11:16 +08:00 committed by imspace
parent 73eeb73680
commit bafec72d37
6 changed files with 61 additions and 5 deletions

View File

@ -14,7 +14,20 @@
"cache/", "cache/",
".vscode/", ".vscode/",
".github/", ".github/",
"profile.json" "profile.json",
"gui/"
]
}
},
"lint": {
"files": {
"exclude": [
"export/",
"cache/",
".vscode/",
".github/",
"profile.json",
"gui/"
] ]
} }
} }

1
gui/.gitignore vendored
View File

@ -11,6 +11,7 @@ node_modules
dist dist
dist-ssr dist-ssr
*.local *.local
binaries/
# Editor directories and files # Editor directories and files
.vscode/* .vscode/*

7
gui/scripts/compile.sh Executable file
View File

@ -0,0 +1,7 @@
TARGETS="x86_64-unknown-linux-gnu,x86_64-pc-windows-msvc,x86_64-apple-darwin,aarch64-apple-darwin"
# compile for every target in bash
for target in $(echo $TARGETS | sed "s/,/ /g")
do
deno compile --target=$target -o ./binaries/s3si-$target ../s3si.ts
done

View File

@ -1504,6 +1504,16 @@ dependencies = [
"windows-sys 0.42.0", "windows-sys 0.42.0",
] ]
[[package]]
name = "os_pipe"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a53dbb20faf34b16087a931834cba2d7a73cc74af2b7ef345a4c8324e2409a12"
dependencies = [
"libc",
"windows-sys 0.45.0",
]
[[package]] [[package]]
name = "overload" name = "overload"
version = "0.1.1" version = "0.1.1"
@ -2187,6 +2197,16 @@ dependencies = [
"lazy_static", "lazy_static",
] ]
[[package]]
name = "shared_child"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef"
dependencies = [
"libc",
"winapi",
]
[[package]] [[package]]
name = "siphasher" name = "siphasher"
version = "0.3.10" version = "0.3.10"
@ -2399,6 +2419,7 @@ dependencies = [
"objc", "objc",
"once_cell", "once_cell",
"open", "open",
"os_pipe",
"percent-encoding", "percent-encoding",
"rand 0.8.5", "rand 0.8.5",
"raw-window-handle", "raw-window-handle",
@ -2408,6 +2429,7 @@ dependencies = [
"serde_json", "serde_json",
"serde_repr", "serde_repr",
"serialize-to-javascript", "serialize-to-javascript",
"shared_child",
"state", "state",
"tar", "tar",
"tauri-macros", "tauri-macros",

View File

@ -13,7 +13,7 @@ edition = "2021"
tauri-build = { version = "1.2", features = [] } tauri-build = { version = "1.2", features = [] }
[dependencies] [dependencies]
tauri = { version = "1.2", features = ["shell-open"] } tauri = { version = "1.2", features = ["shell-open", "shell-sidecar"] }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"

View File

@ -14,6 +14,16 @@
"allowlist": { "allowlist": {
"all": false, "all": false,
"shell": { "shell": {
"sidecar": true,
"scope": [
{
"name": "../binaries/s3si",
"sidecar": true,
"args": [
"--daemon"
]
}
],
"all": false, "all": false,
"open": true "open": true
} }
@ -28,7 +38,10 @@
"icons/icon.ico" "icons/icon.ico"
], ],
"identifier": "cn.imspace.s3si.ts", "identifier": "cn.imspace.s3si.ts",
"targets": "all" "targets": "all",
"externalBin": [
"../binaries/s3si"
]
}, },
"security": { "security": {
"csp": null "csp": null