2020-01-28 13:19:24 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euxo pipefail
|
|
|
|
|
2021-11-22 03:55:21 +03:00
|
|
|
VERSION=${REF#"refs/tags/"}
|
|
|
|
SRC=`pwd`
|
|
|
|
DIST=$SRC/dist
|
2020-01-28 13:19:24 +03:00
|
|
|
|
2021-11-22 03:55:21 +03:00
|
|
|
echo "Packaging just $VERSION for $TARGET..."
|
2020-01-28 13:19:24 +03:00
|
|
|
|
|
|
|
test -f Cargo.lock || cargo generate-lockfile
|
|
|
|
|
2021-11-22 03:55:21 +03:00
|
|
|
echo "Building just..."
|
|
|
|
RUSTFLAGS="--deny warnings --codegen target-feature=+crt-static $TARGET_RUSTFLAGS" \
|
|
|
|
cargo build --bin just --target $TARGET --release
|
|
|
|
EXECUTABLE=target/$TARGET/release/just
|
2020-01-28 13:19:24 +03:00
|
|
|
|
2021-11-22 03:55:21 +03:00
|
|
|
if [[ $OS == windows-2016 ]]; then
|
|
|
|
EXECUTABLE=$EXECUTABLE.exe
|
2021-10-12 03:16:30 +03:00
|
|
|
fi
|
2020-01-28 13:19:24 +03:00
|
|
|
|
|
|
|
echo "Copying release files..."
|
|
|
|
mkdir dist
|
2020-01-28 13:55:30 +03:00
|
|
|
cp \
|
2021-11-22 03:55:21 +03:00
|
|
|
$EXECUTABLE \
|
2020-01-28 13:19:24 +03:00
|
|
|
Cargo.lock \
|
|
|
|
Cargo.toml \
|
|
|
|
GRAMMAR.md \
|
|
|
|
LICENSE \
|
|
|
|
README.adoc \
|
2020-01-28 13:55:30 +03:00
|
|
|
man/just.1 \
|
2021-11-22 03:55:21 +03:00
|
|
|
$DIST
|
2020-01-28 13:19:24 +03:00
|
|
|
|
2021-11-22 03:55:21 +03:00
|
|
|
cd $DIST
|
2020-01-28 13:19:24 +03:00
|
|
|
echo "Creating release archive..."
|
2021-11-22 03:55:21 +03:00
|
|
|
case $OS in
|
2020-01-28 13:19:24 +03:00
|
|
|
ubuntu-latest | macos-latest)
|
2021-11-22 03:55:21 +03:00
|
|
|
ARCHIVE=$DIST/just-$VERSION-$TARGET.tar.gz
|
|
|
|
tar czf $ARCHIVE *
|
|
|
|
echo "::set-output name=archive::$ARCHIVE"
|
2020-01-28 13:19:24 +03:00
|
|
|
;;
|
2020-08-06 05:20:11 +03:00
|
|
|
windows-2016)
|
2021-11-22 03:55:21 +03:00
|
|
|
ARCHIVE=$DIST/just-$VERSION-$TARGET.zip
|
|
|
|
7z a $ARCHIVE *
|
|
|
|
echo "::set-output name=archive::`pwd -W`/just-$VERSION-$TARGET.zip"
|
2020-01-28 13:19:24 +03:00
|
|
|
;;
|
|
|
|
esac
|