Skip to content

Commit 763cbf8

Browse files
committed
Add scripts/dist.sh to generate distribution tarball
1 parent ff99a77 commit 763cbf8

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/target
22
*.db
3+
/dist

scripts/dist.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
# Build static Linux binary using musl
3+
set -euo pipefail
4+
5+
VERSION=0.1.0
6+
TMP="$(mktemp -d)"
7+
DESTDIR="$TMP/notifiers-$VERSION-linux-x86_64"
8+
mkdir -p "$DESTDIR"
9+
# --no-track prevents creation of .crates.toml and .crates2.json
10+
cargo install --no-track --path . --root "$DESTDIR" --target x86_64-unknown-linux-musl --features openssl/vendored
11+
mv "$DESTDIR/bin/notifiers" "$DESTDIR"
12+
rmdir "$DESTDIR/bin"
13+
pushd "$TMP"
14+
tar czf "notifiers-$VERSION-linux-x86_64.tar.gz" "notifiers-$VERSION-linux-x86_64"
15+
popd
16+
mkdir -p dist
17+
mv "$TMP/notifiers-$VERSION-linux-x86_64.tar.gz" "dist/notifiers-$VERSION-linux-x86_64.tar.gz"
18+
rm -fr "$TMP"

0 commit comments

Comments
 (0)