-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
executable file
·24 lines (19 loc) · 668 Bytes
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/bash
set -e
set -u
set -o pipefail
# For information about setting up cross-compliation from Linux to Mac OS:
# https://www.reddit.com/r/rust/comments/6rxoty/tutorial_cross_compiling_from_linux_for_osx/
# http://alwayscoding.ca/momentos/2016/05/08/cross-compilation-to-osx-with-rust/
VERSION=$(git describe --tags)
build() {
echo "Building for $1..."
cargo build --release --target $2
tar -cvjf nakacli-$VERSION-$2.tar.bz2 -C target/$2/release nakacli
shasum -a 256 nakacli-$VERSION-$2.tar.bz2 > nakacli-$VERSION-$2.sha256
mv *.bz2 *.sha256 target
}
rustup update
cargo clean
build "Mac OS" x86_64-apple-darwin
build "Linux" x86_64-unknown-linux-gnu