-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to Travis CI and add deploy script (#24)
* Use travis CI * Remove .github
- Loading branch information
1 parent
0e3a17c
commit cad6111
Showing
5 changed files
with
81 additions
and
15 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
addons: | ||
apt: | ||
packages: | ||
- libgmp-dev | ||
language: c | ||
sudo: false | ||
cache: | ||
directories: | ||
- $HOME/.local/bin | ||
- $HOME/.stack | ||
os: | ||
- linux | ||
- osx | ||
before_install: | ||
- sh tools/install-stack.sh | ||
- sh tools/install-ghr.sh | ||
script: | ||
- stack setup | ||
- stack test | ||
- stack build --ghc-options -O2 --pedantic | ||
after_success: | ||
- sh tools/attach-binary.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
set -o errexit -o verbose | ||
|
||
if test ! "$TRAVIS_TAG" | ||
then | ||
echo 'This is not a release build.' | ||
elif test ! "$GITHUB_TOKEN" | ||
then | ||
echo 'The GITHUB_TOKEN environment variable is not set!' | ||
exit 1 | ||
else | ||
echo "Attaching binary for $TRAVIS_OS_NAME to $TRAVIS_TAG..." | ||
OWNER="$(echo "$TRAVIS_REPO_SLUG" | cut -f1 -d/)" | ||
REPO="$(echo "$TRAVIS_REPO_SLUG" | cut -f2 -d/)" | ||
BIN="$(stack path --local-install-root)/bin/$REPO" | ||
BUNDLE_NAME="$REPO-$TRAVIS_TAG-$TRAVIS_OS_NAME.tar.gz" | ||
cp "$BIN" "./$REPO" | ||
chmod +x "./$REPO" | ||
tar -czf "$BUNDLE_NAME" "$REPO" | ||
echo "SHA256:" | ||
shasum -a 256 "$BUNDLE_NAME" | ||
ghr -t "$GITHUB_TOKEN" -u "$OWNER" -r "$REPO" --replace "$(git describe --tags)" "$BUNDLE_NAME" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
set -o errexit -o verbose | ||
|
||
if test ! "$TRAVIS_TAG" | ||
then | ||
echo 'This is not a release build.' | ||
else | ||
if [ "$TRAVIS_OS_NAME" = "linux" ] | ||
then | ||
ARCH="linux" | ||
else | ||
ARCH="darwin" | ||
fi | ||
echo "Installing ghr" | ||
URL="https://github.com/tcnksm/ghr/releases/download/v0.5.4/ghr_v0.5.4_${ARCH}_386.zip" | ||
curl -L ${URL} > ghr.zip | ||
mkdir -p "$HOME/bin" | ||
export PATH="$HOME/bin:$PATH" | ||
unzip ghr.zip -d "$HOME/bin" | ||
rm ghr.zip | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
set -o errexit -o verbose | ||
|
||
if test -f "$HOME/.local/bin/stack" | ||
then | ||
echo 'Stack is already installed.' | ||
else | ||
echo "Installing Stack for $TRAVIS_OS_NAME..." | ||
URL="https://www.stackage.org/stack/$TRAVIS_OS_NAME-x86_64" | ||
curl --location "$URL" > stack.tar.gz | ||
gunzip stack.tar.gz | ||
tar -x -f stack.tar --strip-components 1 | ||
mkdir -p "$HOME/.local/bin" | ||
mv stack "$HOME/.local/bin/" | ||
rm stack.tar | ||
fi | ||
|
||
stack --version |