2020-01-28 02:19:24 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euxo pipefail
|
|
|
|
|
2021-11-21 16:55:21 -08:00
|
|
|
VERSION=${REF#"refs/tags/"}
|
2021-12-05 02:51:15 -08:00
|
|
|
DIST=`pwd`/dist
|
2020-01-28 02:19:24 -08:00
|
|
|
|
2021-11-21 16:55:21 -08:00
|
|
|
echo "Packaging just $VERSION for $TARGET..."
|
2020-01-28 02:19:24 -08:00
|
|
|
|
|
|
|
test -f Cargo.lock || cargo generate-lockfile
|
|
|
|
|
2021-11-21 16:55:21 -08: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 02:19:24 -08:00
|
|
|
|
2021-11-21 16:55:21 -08:00
|
|
|
if [[ $OS == windows-2016 ]]; then
|
|
|
|
EXECUTABLE=$EXECUTABLE.exe
|
2021-10-11 17:16:30 -07:00
|
|
|
fi
|
2020-01-28 02:19:24 -08:00
|
|
|
|
|
|
|
echo "Copying release files..."
|
|
|
|
mkdir dist
|
2020-01-28 02:55:30 -08:00
|
|
|
cp \
|
2021-11-21 16:55:21 -08:00
|
|
|
$EXECUTABLE \
|
2020-01-28 02:19:24 -08:00
|
|
|
Cargo.lock \
|
|
|
|
Cargo.toml \
|
|
|
|
GRAMMAR.md \
|
|
|
|
LICENSE \
|
|
|
|
README.adoc \
|
2020-01-28 02:55:30 -08:00
|
|
|
man/just.1 \
|
2021-11-21 16:55:21 -08:00
|
|
|
$DIST
|
2020-01-28 02:19:24 -08:00
|
|
|
|
2021-11-21 16:55:21 -08:00
|
|
|
cd $DIST
|
2020-01-28 02:19:24 -08:00
|
|
|
echo "Creating release archive..."
|
2021-11-21 16:55:21 -08:00
|
|
|
case $OS in
|
2020-01-28 02:19:24 -08:00
|
|
|
ubuntu-latest | macos-latest)
|
2021-11-21 16:55:21 -08:00
|
|
|
ARCHIVE=$DIST/just-$VERSION-$TARGET.tar.gz
|
|
|
|
tar czf $ARCHIVE *
|
|
|
|
echo "::set-output name=archive::$ARCHIVE"
|
2020-01-28 02:19:24 -08:00
|
|
|
;;
|
2020-08-05 19:20:11 -07:00
|
|
|
windows-2016)
|
2021-11-21 16:55:21 -08:00
|
|
|
ARCHIVE=$DIST/just-$VERSION-$TARGET.zip
|
|
|
|
7z a $ARCHIVE *
|
|
|
|
echo "::set-output name=archive::`pwd -W`/just-$VERSION-$TARGET.zip"
|
2020-01-28 02:19:24 -08:00
|
|
|
;;
|
|
|
|
esac
|