just/bin/package
Casey Rodarmor 5e2b51e83e
Add list highlighting nice features to readme (#664)
This was suggested by @zaiste, to make it clearer how Just differs from
Make, and what features it has.
2020-08-05 19:20:11 -07:00

55 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euxo pipefail
version=${1#"refs/tags/"}
os=$2
target=$3
src=`pwd`
dist=$src/dist
bin=just
echo "Packaging $bin $version for $target..."
test -f Cargo.lock || cargo generate-lockfile
echo "Building $bin..."
case $os in
ubuntu-latest | macos-latest)
cargo rustc --bin $bin --target $target --release
executable=target/$target/release/$bin
;;
windows-2016)
cargo rustc --bin $bin --target $target --release -- -C target-feature="+crt-static"
executable=target/$target/release/$bin.exe
;;
esac
echo "Copying release files..."
mkdir dist
cp \
$executable \
Cargo.lock \
Cargo.toml \
GRAMMAR.md \
LICENSE \
README.adoc \
man/just.1 \
$dist
cd $dist
echo "Creating release archive..."
case $os in
ubuntu-latest | macos-latest)
archive=$dist/$bin-$version-$target.tar.gz
tar czf $archive *
echo "::set-output name=archive::$archive"
;;
windows-2016)
archive=$dist/$bin-$version-$target.zip
7z a $archive *
echo "::set-output name=archive::`pwd -W`/$bin-$version-$target.zip"
;;
esac