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

47 lines
989 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
if [[ $OS == windows-latest ]]; then
2021-11-22 03:55:21 +03:00
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.md \
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-latest)
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