mirror of
https://github.com/watchexec/watchexec.git
synced 2024-09-29 22:51:33 +02:00
Add windows travis builds
This commit is contained in:
parent
f7e1639ed1
commit
24204e7b71
45
.travis.yml
45
.travis.yml
@ -1,20 +1,38 @@
|
|||||||
|
dist: xenial
|
||||||
language: rust
|
language: rust
|
||||||
cache: cargo
|
|
||||||
dist: trusty
|
cache:
|
||||||
sudo: false
|
- directories:
|
||||||
|
- $HOME/.cargo
|
||||||
|
- target/debug/deps
|
||||||
|
- target/$TARGET/debug/deps
|
||||||
|
before_cache:
|
||||||
|
# Travis can't cache files that are not readable by "others"
|
||||||
|
- chmod -R a+r $HOME/.cargo
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- fakeroot
|
- fakeroot
|
||||||
|
- musl-dev
|
||||||
|
- musl-tools
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- PROJECT_NAME=watchexec
|
- PROJECT_NAME=watchexec
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
|
fast_finish: true
|
||||||
|
allow_failures:
|
||||||
|
- env: CARGO_CLIPPY=1
|
||||||
|
- env: TARGET=i686-unknown-linux-musl
|
||||||
|
- env: TARGET=x86_64-unknown-linux-musl
|
||||||
|
- env: TARGET=x86_64-pc-windows-gnu
|
||||||
include:
|
include:
|
||||||
# Default test+release version
|
# Default test+release versions
|
||||||
|
- os: windows
|
||||||
|
rust: stable
|
||||||
|
env: TARGET=x86_64-pc-windows-msvc
|
||||||
- os: osx
|
- os: osx
|
||||||
rust: stable
|
rust: stable
|
||||||
env: TARGET=x86_64-apple-darwin
|
env: TARGET=x86_64-apple-darwin
|
||||||
@ -22,27 +40,32 @@ matrix:
|
|||||||
rust: stable
|
rust: stable
|
||||||
env: TARGET=x86_64-unknown-linux-gnu
|
env: TARGET=x86_64-unknown-linux-gnu
|
||||||
|
|
||||||
# Extra targets for linux only
|
# Extra targets, released on best-effort
|
||||||
- os: linux
|
- os: linux
|
||||||
rust: stable
|
rust: stable
|
||||||
env: TARGET=i686-unknown-linux-musl
|
env: TARGET=i686-unknown-linux-musl
|
||||||
- os: linux
|
- os: linux
|
||||||
rust: stable
|
rust: stable
|
||||||
env: TARGET=x86_64-unknown-linux-musl
|
env: TARGET=x86_64-unknown-linux-musl
|
||||||
|
- os: windows
|
||||||
|
rust: stable
|
||||||
|
env: TARGET=x86_64-pc-windows-gnu
|
||||||
|
|
||||||
# Minimum version advertised in readme
|
# Minimum version advertised in readme
|
||||||
|
- os: windows
|
||||||
|
rust: 1.38.0
|
||||||
|
env: TARGET=x86_64-apple-darwin
|
||||||
- os: linux
|
- os: linux
|
||||||
rust: 1.38.0
|
rust: 1.38.0
|
||||||
env: TARGET=x86_64-unknown-linux-gnu
|
env: TARGET=x86_64-unknown-linux-gnu
|
||||||
- os: osx
|
|
||||||
rust: 1.38.0
|
|
||||||
env: TARGET=x86_64-apple-darwin
|
|
||||||
fast_finish: true
|
|
||||||
|
|
||||||
before_script: ci/before_script.sh
|
# Clippy only
|
||||||
|
- env: CARGO_CLIPPY=1
|
||||||
|
|
||||||
|
before_install: ci/before.sh
|
||||||
script: ci/script.sh
|
script: ci/script.sh
|
||||||
|
|
||||||
before_deploy: ci/before_deploy.sh
|
before_deploy: ci/deploy.sh
|
||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
provider: releases
|
||||||
api_key:
|
api_key:
|
||||||
|
18
ci/before.sh
Executable file
18
ci/before.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
rustup target add $TARGET
|
||||||
|
cargo clean --target $TARGET --verbose
|
||||||
|
|
||||||
|
if [ $TRAVIS_OS_NAME = windows ]; then
|
||||||
|
choco install windows-sdk-10.1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$CARGO_AUDIT" ]]; then
|
||||||
|
which cargo-audit || cargo install --debug cargo-audit
|
||||||
|
# --debug for faster build at the minimal expense of runtime speed
|
||||||
|
elif [[ ! -z "$CARGO_CLIPPY" ]]; then
|
||||||
|
rustup component add clippy
|
||||||
|
fi
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Build script shamelessly stolen from ripgrep :)
|
|
||||||
|
|
||||||
cargo build --target $TARGET --release --locked
|
|
||||||
|
|
||||||
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,completions/zsh} "$build_dir/$name/"
|
|
||||||
|
|
||||||
pushd $build_dir
|
|
||||||
tar cvf "$out_dir/$name.tar" *
|
|
||||||
popd
|
|
||||||
gzip -f9 "$name.tar"
|
|
||||||
|
|
||||||
|
|
||||||
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 usr/share/zsh/site-functions
|
|
||||||
cp "../../$name/watchexec" usr/bin/
|
|
||||||
cp "../../$name/watchexec.1" usr/share/man/man1/
|
|
||||||
cp "../../$name/zsh" usr/share/zsh/site-functions/_watchexec
|
|
||||||
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
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
rustup target add $TARGET
|
|
||||||
cargo clean --target $TARGET --verbose
|
|
83
ci/deploy.sh
Executable file
83
ci/deploy.sh
Executable file
@ -0,0 +1,83 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
### Vars
|
||||||
|
|
||||||
|
project="$PROJECT_NAME"
|
||||||
|
tag="$TRAVIS_TAG"
|
||||||
|
target="$TARGET"
|
||||||
|
|
||||||
|
[[ -z "$project" ]] && exit 21
|
||||||
|
[[ -z "$tag" ]] && exit 22
|
||||||
|
[[ -z "$target" ]] && exit 23
|
||||||
|
|
||||||
|
ext=""
|
||||||
|
windows=""
|
||||||
|
if [[ "$target" == *"windows"* ]]; then
|
||||||
|
choco install 7zip
|
||||||
|
ext=".exe"
|
||||||
|
windows="1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
project="cargo-watch"
|
||||||
|
build_dir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
|
||||||
|
out_dir=$(pwd)
|
||||||
|
name="$project-$tag-$target"
|
||||||
|
|
||||||
|
### Build
|
||||||
|
|
||||||
|
cargo build --target $target --release --locked
|
||||||
|
|
||||||
|
### Decorate
|
||||||
|
|
||||||
|
mkdir "$build_dir/$name"
|
||||||
|
cp -v "target/$target/release/$project$ext" "$build_dir/$name/"
|
||||||
|
cp -v LICENSE "$build_dir/$name/"
|
||||||
|
cp -v README.md "$build_dir/$name/"
|
||||||
|
cp -v completions/zsh "$build_dir/$name/"
|
||||||
|
cp -v doc/watchexec.1 "$build_dir/$name/"
|
||||||
|
ls -shal "$build_dir/$name/"
|
||||||
|
|
||||||
|
### Strip
|
||||||
|
|
||||||
|
cd "$build_dir"
|
||||||
|
strip "$name/$project$ext"
|
||||||
|
ls -shal "$name/"
|
||||||
|
|
||||||
|
### Pack
|
||||||
|
|
||||||
|
if [[ -z "$windows" ]]; then
|
||||||
|
tar cvf "$out_dir/$name.tar" "$name"
|
||||||
|
cd "$out_dir"
|
||||||
|
xz -f9 "$name.tar"
|
||||||
|
else
|
||||||
|
7z a "$out_dir/$name.zip" "$name"
|
||||||
|
fi
|
||||||
|
|
||||||
|
### Debify
|
||||||
|
|
||||||
|
if [[ "$target" == "x86_64-unknown-linux-gnu" ]]; then
|
||||||
|
mkdir -p "$build_dir/deb/$name"
|
||||||
|
cd "$build_dir/deb/$name"
|
||||||
|
|
||||||
|
mkdir -p DEBIAN usr/bin usr/share/man/man1 usr/share/zsh/site-functions
|
||||||
|
cp "../../$name/watchexec" usr/bin/
|
||||||
|
cp "../../$name/watchexec.1" usr/share/man/man1/
|
||||||
|
cp "../../$name/zsh" usr/share/zsh/site-functions/_watchexec
|
||||||
|
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
|
||||||
|
|
||||||
|
ls -shal "$out_dir/"
|
10
ci/script.sh
10
ci/script.sh
@ -1,4 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
cargo build --target $TARGET --verbose
|
if [[ ! -z "$CARGO_AUDIT" ]]; then
|
||||||
cargo test --target $TARGET --verbose
|
cargo check --target $TARGET
|
||||||
|
cargo audit
|
||||||
|
elif [[ ! -z "$CARGO_CLIPPY" ]]; then
|
||||||
|
cargo clippy --target $TARGET
|
||||||
|
else
|
||||||
|
cargo test --target $TARGET
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user