1
1
mirror of https://github.com/casey/just.git synced 2024-11-23 11:04:09 +03:00
just/bin/package

47 lines
987 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
set -euxo pipefail
2021-11-22 03:55:21 +03:00
VERSION=${REF#"refs/tags/"}
2021-12-05 13:51:15 +03:00
DIST=`pwd`/dist
2021-11-22 03:55:21 +03:00
echo "Packaging just $VERSION for $TARGET..."
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
2021-11-22 03:55:21 +03:00
if [[ $OS == windows-2016 ]]; then
EXECUTABLE=$EXECUTABLE.exe
fi
echo "Copying release files..."
mkdir dist
cp \
2021-11-22 03:55:21 +03:00
$EXECUTABLE \
Cargo.lock \
Cargo.toml \
GRAMMAR.md \
LICENSE \
README.adoc \
man/just.1 \
2021-11-22 03:55:21 +03:00
$DIST
2021-11-22 03:55:21 +03:00
cd $DIST
echo "Creating release archive..."
2021-11-22 03:55:21 +03:00
case $OS in
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"
;;
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"
;;
esac