forked from ordinals/ord
-
Notifications
You must be signed in to change notification settings - Fork 2
/
package
executable file
Β·44 lines (36 loc) Β· 944 Bytes
/
package
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
40
41
42
43
44
#!/usr/bin/env bash
set -euxo pipefail
VERSION=${REF#"refs/tags/"}
DIST=`pwd`/dist
echo "Packaging ord $VERSION for $TARGET..."
test -f Cargo.lock || cargo generate-lockfile
echo "Building ord..."
RUSTFLAGS="--deny warnings $TARGET_RUSTFLAGS" \
cargo build --bin ord --target $TARGET --release
EXECUTABLE=target/$TARGET/release/ord
if [[ $OS == windows-latest ]]; then
EXECUTABLE=$EXECUTABLE.exe
fi
echo "Copying release files..."
mkdir -p dist/ord-$VERSION
cp \
$EXECUTABLE \
Cargo.lock \
Cargo.toml \
LICENSE \
README.md \
$DIST/ord-$VERSION
cd $DIST
echo "Creating release archive..."
case $OS in
ubuntu-latest | macos-latest)
ARCHIVE=$DIST/ord-$VERSION-$TARGET.tar.gz
tar czf $ARCHIVE *
echo "::set-output name=archive::$ARCHIVE"
;;
windows-latest)
ARCHIVE=$DIST/ord-$VERSION-$TARGET.zip
7z a $ARCHIVE *
echo "::set-output name=archive::`pwd -W`/ord-$VERSION-$TARGET.zip"
;;
esac