watchexec/ci/before_deploy.sh

45 lines
1.3 KiB
Bash
Raw Normal View History

2018-08-21 06:28:42 +02:00
#!/usr/bin/env bash
2016-10-14 04:09:34 +02:00
# Build script shamelessly stolen from ripgrep :)
cargo build --target $TARGET --release
build_dir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
out_dir=$(pwd)
name="${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}"
mkdir "$build_dir/$name"
cp target/$TARGET/release/watchexec "$build_dir/$name/"
cp {doc/watchexec.1,LICENSE} "$build_dir/$name/"
2016-10-14 04:09:34 +02:00
pushd $build_dir
2018-08-21 06:28:42 +02:00
tar cvf "$out_dir/$name.tar" *
2016-10-14 04:09:34 +02:00
popd
2018-08-21 06:28:42 +02:00
gzip -f9 "$name.tar"
2018-09-09 04:53:11 +02:00
if [[ "$TARGET" == "x86_64-unknown-linux-gnu" ]]; then
mkdir -p "$build_dir/deb/$name"
pushd "$build_dir/deb/$name"
mkdir -p DEBIAN usr/bin usr/share/man/man1
cp "../../$name/watchexec" usr/bin/
cp "../../$name/watchexec.1" usr/share/man/man1/
cat <<CONTROL > DEBIAN/control
Package: watchexec
Version: ${TRAVIS_TAG}
Architecture: amd64
Maintainer: Félix Saparelli <aur@passcod.name>
Installed-Size: $(du -d1 usr | tail -n1 | cut -d\t -f1)
Homepage: https://github.com/watchexec/watchexec
Description: Executes commands in response to file modifications.
Software development often involves running the same commands over and over. Boring!
Watchexec is a simple, standalone tool that watches a path and runs a command whenever it detects modifications.
CONTROL
cd ..
fakeroot dpkg -b "$name"
mv "$name.deb" "$out_dir/"
popd
fi