Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Commit

Permalink
Merge branch 'travis-win'
Browse files Browse the repository at this point in the history
  • Loading branch information
passcod committed Oct 19, 2018
2 parents c0a3ad2 + 2f29fc4 commit 2f1715e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 55 deletions.
48 changes: 38 additions & 10 deletions .package
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

### Args

tag=$1
target=$2

Expand All @@ -14,27 +16,53 @@ if [[ -z "$target" ]]; then
fi


cargo build --target $target --release
### Vars

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"
mkdir "$build_dir/$name"

cp target/$target/release/$project "$build_dir/$name/"
### Build

cargo build --target $target --release

### Decorate

mkdir "$build_dir/$name"
cp "target/$target/release/$project$ext" "$build_dir/$name/"
cp LICENSE "$build_dir/$name/"
ls -shal "$build_dir/$name/"

### Strip

pushd $build_dir
strip "$name/$project"
tar cvf "$out_dir/$name.tar" "$name"
popd
xz -f9 "$name.tar"
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"
pushd "$build_dir/deb/$name"
cd "$build_dir/deb/$name"

mkdir -p DEBIAN usr/bin
cp "../../$name/$project" usr/bin/
Expand All @@ -51,6 +79,6 @@ CONTROL
cd ..
fakeroot dpkg -b "$name"
mv "$name.deb" "$out_dir/"
popd
fi

ls -shal "$out_dir/"
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,32 @@ env:

matrix:
include:
# Default test+release version
# Default test+release versions
- os: windows
rust: stable
env: TARGET=x86_64-pc-windows-msvc
- os: osx
rust: stable
env: TARGET=x86_64-apple-darwin
- os: linux
rust: stable
env: TARGET=x86_64-unknown-linux-gnu

# Extra targets for linux only
- os: linux
# Extra targets, also released
- os: windows
rust: stable
env: TARGET=i686-unknown-linux-musl
env: TARGET=x86_64-pc-windows-gnu
- os: linux
rust: stable
env: TARGET=x86_64-unknown-linux-musl
- os: linux
rust: stable
env: TARGET=i686-unknown-linux-musl

# Non-critical but interesting for upcoming Rust changes
- os: windows
rust: nightly
env: TARGET=x86_64-pc-windows-msvc
- os: linux
rust: nightly
env: TARGET=x86_64-unknown-linux-gnu
Expand Down
41 changes: 0 additions & 41 deletions appveyor.yml

This file was deleted.

0 comments on commit 2f1715e

Please sign in to comment.