Skip to content

Commit

Permalink
compress binaries, add install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed Nov 26, 2019
1 parent 1d2efae commit 22d4298
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
directories:
- ${STACK_HOME}
before_deploy:
- cp ${STACK_BIN}/unfog ${STACK_BIN}/unfog-${TRAVIS_OS_NAME}
- tar czf "${STACK_BIN}/unfog-${TRAVIS_OS_NAME}.tar.gz" -C "${STACK_BIN}" unfog
deploy: &deploy_base
provider: releases
api_key: ${GITHUB_TOKEN}
file: ${STACK_BIN}/unfog-${TRAVIS_OS_NAME}
file: ${STACK_BIN}/unfog-${TRAVIS_OS_NAME}.tar.gz
skip_cleanup: true
draft: false
name: ${TRAVIS_TAG}
Expand All @@ -37,7 +37,7 @@ jobs:
directories:
- ${STACK_HOME}
before_deploy:
- cp ${STACK_BIN}/unfog ${STACK_BIN}/unfog-${TRAVIS_OS_NAME}
- tar czf "${STACK_BIN}/unfog-${TRAVIS_OS_NAME}.tar.gz" -C "${STACK_BIN}" unfog
deploy:
<<: *deploy_base

Expand All @@ -50,7 +50,7 @@ jobs:
- ${STACK_HOME}
- ${HOME}/AppData/Local/Programs/stack
before_deploy:
- cp ${STACK_BIN}/unfog.exe ${STACK_BIN}/unfog-${TRAVIS_OS_NAME}.exe
- mv "${STACK_BIN}/unfog" "${STACK_BIN}/unfog.exe"
- tar czf "${STACK_BIN}/unfog-${TRAVIS_OS_NAME}.tar.gz" -C "${STACK_BIN}" unfog.exe
deploy:
<<: *deploy_base
file: ${STACK_BIN}/unfog-${TRAVIS_OS_NAME}.exe
27 changes: 27 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

get_os () {
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo "linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "osx"
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo "windows"
elif [[ "$OSTYPE" == "msys" ]]; then
echo "windows"
elif [[ "$OSTYPE" == "win32" ]]; then
echo "windows"
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo "linux"
else
return -1
fi
}

cd /tmp
os=`get_os`
curl -Lo unfog.tar.gz "https://github.com/unfog-io/unfog-cli/releases/latest/download/unfog-${os}.tar.gz"
tar xzf unfog.tar.gz
rm unfog.tar.gz
chmod u+x unfog*
sudo mv unfog* /usr/local/bin/
3 changes: 1 addition & 2 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: unfog
version: 0.1.3
version: 0.1.4
github: "unfog-io/unfog-cli"
license: BSD3
author: "Clément DOUIN"
Expand Down Expand Up @@ -42,7 +42,6 @@ executables:
- -rtsopts
- -with-rtsopts=-N
- -O2
- -split-objs
dependencies:
- unfog

Expand Down

0 comments on commit 22d4298

Please sign in to comment.