Set up the file service packaging script

Improve the dist script
This commit is contained in:
Savanni D'Gerinel 2023-10-03 20:18:41 -04:00
parent 2f6be84a43
commit 1d89254413
2 changed files with 14 additions and 5 deletions

View File

@ -6,9 +6,6 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
auth-cli = [ "clap" ]
[lib] [lib]
name = "file_service" name = "file_service"
path = "src/lib.rs" path = "src/lib.rs"
@ -20,7 +17,6 @@ path = "src/main.rs"
[[bin]] [[bin]]
name = "auth-cli" name = "auth-cli"
path = "src/bin/cli.rs" path = "src/bin/cli.rs"
required-features = [ "auth-cli" ]
[target.auth-cli.dependencies] [target.auth-cli.dependencies]
@ -29,7 +25,7 @@ base64ct = { version = "1", features = [ "alloc" ] }
build_html = { version = "2" } build_html = { version = "2" }
bytes = { version = "1" } bytes = { version = "1" }
chrono = { version = "0.4", features = ["serde"] } chrono = { version = "0.4", features = ["serde"] }
clap = { version = "4", features = [ "derive" ], optional = true } clap = { version = "4", features = [ "derive" ] }
cookie = { version = "0.17" } cookie = { version = "0.17" }
futures-util = { version = "0.3" } futures-util = { version = "0.3" }
hex-string = "0.1.0" hex-string = "0.1.0"

13
file-service/dist.sh Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
VERSION=`cat Cargo.toml | grep "^version =" | sed -r 's/^version = "(.+)"$/\1/'`
mkdir -p dist
cp ../target/release/file-service dist
cp ../target/release/auth-cli dist
strip dist/file-service
strip dist/auth-cli
tar -cf file-service-${VERSION}.tar.gz dist/