1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
ripgrep/ci/before_deploy.sh

53 lines
1.2 KiB
Bash
Raw Normal View History

#!/bin/bash
# package the build artifacts
2016-09-06 02:08:46 +02:00
set -ex
. "$(dirname $0)/utils.sh"
2016-09-06 02:08:46 +02:00
# Generate artifacts for release
mk_artifacts() {
if is_ssse3_target; then
RUSTFLAGS="-C target-feature=+ssse3" \
cargo build --target "$TARGET" --release --features simd-accel
else
cargo build --target "$TARGET" --release
fi
2016-09-06 02:08:46 +02:00
}
mk_tarball() {
local gcc_prefix="$(gcc_prefix)"
local td="$(mktemp -d)"
local name="${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}"
local staging="$td/$name"
mkdir -p "$staging/complete"
local out_dir="$(pwd)/deployment"
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.
cp \
target/"$TARGET"/release/build/ripgrep-*/out/{rg.bash,rg.fish,_rg.ps1} \
"$staging/complete/"
2017-05-29 22:02:09 +02:00
cp complete/_rg "$td/$name/complete/"
# Copy man page.
cp \
target/"$TARGET"/release/build/ripgrep-*/out/rg.1 \
"$td/$name/"
2016-09-06 02:08:46 +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