2018-02-04 19:14:38 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# package the build artifacts
|
2016-09-06 02:08:46 +02:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2018-02-04 19:14:38 +02:00
|
|
|
. "$(dirname $0)/utils.sh"
|
2016-09-06 02:08:46 +02:00
|
|
|
|
|
|
|
# Generate artifacts for release
|
|
|
|
mk_artifacts() {
|
2017-12-17 15:41:51 +02:00
|
|
|
if is_ssse3_target; then
|
|
|
|
RUSTFLAGS="-C target-feature=+ssse3" \
|
2018-02-04 19:14:38 +02:00
|
|
|
cargo build --target "$TARGET" --release --features simd-accel
|
2017-12-17 15:41:51 +02:00
|
|
|
else
|
2018-02-04 19:14:38 +02:00
|
|
|
cargo build --target "$TARGET" --release
|
2017-12-17 15:41:51 +02:00
|
|
|
fi
|
2016-09-06 02:08:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mk_tarball() {
|
2017-12-17 15:41:51 +02:00
|
|
|
local gcc_prefix="$(gcc_prefix)"
|
2018-02-04 19:14:38 +02:00
|
|
|
local td="$(mktemp -d)"
|
|
|
|
local name="${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}"
|
2018-02-06 01:45:45 +02:00
|
|
|
local staging="$td/$name"
|
|
|
|
mkdir -p "$staging/complete"
|
2018-02-04 19:14:38 +02:00
|
|
|
local out_dir="$(pwd)/deployment"
|
2018-02-06 01:45:45 +02:00
|
|
|
mkdir -p "$out_dir"
|
|
|
|
|
|
|
|
# Copy the ripgrep binary and strip it.
|
|
|
|
cp target/$TARGET/release/rg "$staging/rg"
|
|
|
|
"${gcc_prefix}strip" "$staging/rg"
|
|
|
|
# Copy the README and licenses.
|
|
|
|
cp {README.md,UNLICENSE,COPYING,LICENSE-MIT} "$staging/"
|
|
|
|
# Copy shell completion files.
|
2017-08-24 00:06:53 +02:00
|
|
|
cp \
|
2018-02-04 19:14:38 +02:00
|
|
|
target/"$TARGET"/release/build/ripgrep-*/out/{rg.bash,rg.fish,_rg.ps1} \
|
2018-02-06 01:45:45 +02:00
|
|
|
"$staging/complete/"
|
2017-05-29 22:02:09 +02:00
|
|
|
cp complete/_rg "$td/$name/complete/"
|
2018-02-06 01:45:45 +02:00
|
|
|
# Copy man page.
|
|
|
|
cp \
|
|
|
|
target/"$TARGET"/release/build/ripgrep-*/out/rg.1 \
|
|
|
|
"$td/$name/"
|
2016-09-06 02:08:46 +02:00
|
|
|
|
2018-02-04 19:14:38 +02:00
|
|
|
(cd "$td" && tar czf "$out_dir/$name.tar.gz" *)
|
|
|
|
rm -rf "$td"
|
2016-09-06 02:08:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
main() {
|
|
|
|
mk_artifacts
|
|
|
|
mk_tarball
|
|
|
|
}
|
|
|
|
|
|
|
|
main
|