Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
improve mac packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
bnadim committed Dec 6, 2016
1 parent 22c3768 commit c8eb245
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ os:
- linux
- osx

osx_image: xcode8.1

branches:
only:
- master
Expand All @@ -24,14 +26,9 @@ script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make unison-mac ; fi;
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make unison-alpine ; fi

after_success:
- if [[ "$TRAVIS_BRANCH" == "master" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
make publish;
fi
- if [[ -n "$TRAVIS_TAG" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
VERSION=$TRAVIS_TAG make publish;
before_deploy:
- if [[ -n "$TRAVIS_TAG" ]] && [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
VERSION=$TRAVIS_TAG make package-mac-unison;
fi

deploy:
Expand All @@ -40,5 +37,15 @@ deploy:
condition: $TRAVIS_OS_NAME = osx
provider: releases
api_key: $GITHUB_OAUTH
file: output/mac/unison
file: output/unison-${TRAVIS_TAG}-osx64.tar.gz
skip_cleanup: true

after_success:
- if [[ "$TRAVIS_BRANCH" == "master" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
make publish;
fi
- if [[ -n "$TRAVIS_TAG" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
VERSION=$TRAVIS_TAG make publish;
fi
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,12 @@ publish:
@docker build -t keepitcool/docker-sync:${VERSION} .
@docker push keepitcool/docker-sync:${VERSION}

package-mac-unison:
@-rm -R output/unison-${VERSION}-osx64
@mkdir -p output/unison-${VERSION}-osx64
@cp output/mac/unison output/unison-${VERSION}-osx64
@cd output && tar cvzf unison-${VERSION}-osx64.tar.gz unison-${VERSION}-osx64/
@-rm -R output/unison-${VERSION}-osx64

clean: ## Clean
@rm -R build

0 comments on commit c8eb245

Please sign in to comment.