OS X package build on Travis
This builds an OS X package and deploys it to a GitHub release when a tag is pushed. It also generates a tarball reporting the build environment and configuration. The build log is still separate. This is not yet final, it deploys to cgull/mosh and not mobile-shell/mosh. It should not affect Linux or OS X CI builds (other than the change to the Travis Xcode 7.1 image). Included changes: The Travis Xcode 7 image seems to have added tmux while we were gone, breaking our Homebrew setup. There seems to be no clean reliable way to determine whether a Homebrew package is installed or needs updating. Reinstalling is less efficient but seems to work reliably. The OS X build is now split between four files: .travis.yml contains Travis-specific CI/release build configuration. macosx/brew.sh contains Homebrew-specific package manager installs and reporting. macosx/osx-xcode.sh contains Apple-specific OS/X and Xcode reporting. macosx/build.sh does the actual package build.
This commit is contained in:
+74
-7
@@ -1,5 +1,5 @@
|
||||
osx_image: xcode8
|
||||
|
||||
# This does Travis CI builds on Linux and OS X, and on a tag build,
|
||||
# also produces an OS X package.
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
@@ -8,28 +8,95 @@ cache:
|
||||
- apt
|
||||
|
||||
language: cpp
|
||||
|
||||
# Use the Ubuntu 14.04 build environment for Linux.
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
# Currently we're using the Travis Xcode 7.1/OS X 10.10 image to
|
||||
# get i386/x86_64 fat binaries.
|
||||
osx_image: xcode7.1
|
||||
|
||||
# Linux dependencies
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
# For build.
|
||||
- protobuf-compiler
|
||||
- libprotobuf-dev
|
||||
- libutempter-dev
|
||||
- tmux # test suite
|
||||
- perl # test suite
|
||||
# Test suite needs these.
|
||||
- tmux
|
||||
- perl
|
||||
|
||||
before_install:
|
||||
- if test "$TRAVIS_OS_NAME" = osx; then brew update; fi
|
||||
- if test "$TRAVIS_OS_NAME" = osx; then brew install protobuf tmux; fi
|
||||
- if test "$TRAVIS_OS_NAME" = osx; then brew outdated protobuf tmux || brew upgrade protobuf tmux; fi
|
||||
# Get full repo for `git describe`
|
||||
- git fetch --tags --unshallow
|
||||
# OS X dependencies. The package_deps step takes 15 minutes or so
|
||||
# and is fairly quiet, so wrap it in travis_wait to keep it from
|
||||
# being killed.
|
||||
- |
|
||||
(
|
||||
set -e
|
||||
if test osx = "${TRAVIS_OS_NAME}"; then
|
||||
macosx/brew-deps.sh install
|
||||
if test -n "${TRAVIS_TAG}"; then
|
||||
travis_wait 30 macosx/brew-deps.sh package_deps
|
||||
else
|
||||
macosx/brew-deps.sh deps
|
||||
fi
|
||||
fi
|
||||
)
|
||||
|
||||
# Use before_script to report the build configuration.
|
||||
before_script:
|
||||
# Describe this system.
|
||||
- id
|
||||
- env
|
||||
- git describe --long
|
||||
- |
|
||||
(
|
||||
set -e
|
||||
if test osx = "${TRAVIS_OS_NAME}" && test -n "${TRAVIS_TAG}"; then
|
||||
rm -rf macosx/build-report "macosx/${TRAVIS_TAG}-build-report.tbz"
|
||||
mkdir macosx/build-report
|
||||
cd macosx/build-report
|
||||
../brew-deps.sh describe
|
||||
../osx-xcode.sh describe
|
||||
tar -cjf "../${TRAVIS_TAG}-build-report.tbz" .
|
||||
fi
|
||||
)
|
||||
|
||||
# 'make distcheck', and OS X package build on tag builds.
|
||||
script:
|
||||
- ./autogen.sh
|
||||
- ./configure --enable-compile-warnings=error --enable-examples
|
||||
- make distcheck VERBOSE=1 V=1
|
||||
# Build OS X package for tags.
|
||||
- |
|
||||
if test osx = "${TRAVIS_OS_NAME}" && test -n "${TRAVIS_TAG}"; then
|
||||
(
|
||||
set -e
|
||||
cd macosx
|
||||
env MACOSX_DEPLOYMENT_TARGET=10.10 ./build.sh
|
||||
shasum -a 256 "${TRAVIS_TAG}.pkg" "${TRAVIS_TAG}-build-report.tbz"
|
||||
)
|
||||
fi
|
||||
# Deploy the OS X package to a GitHub release.
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: O+EmNHUQpqvrWNb1LYv5CXF9o35Mybi+Y48jr+nV3oJ+dLlwgmP71tDzARY0rEY18xT4DL9RBbl5Y74A4nZxvSMSih+VBUf+lgBhkAFkU5W1sRTaJdQVtJw6NcaeuDR/TvVMpJAPxLtHOZnmqplkQVDn4fpkweGaW0Suk7eSlibF3fd0dhoZ8sfDgWQpUW61C08ENBC9/ru01BqDcNuWA9EoS2aLRVCHKR5C02D2EFONlHTxu32X9qm5IcVrk+Zi5mmqyHk74A4a7QRJCDixKyt53LGXYpQh9flePmzSqZDKO5q3PSmWohoUzGLkKBcZit/mSd5aUeIzd7gk/YHNxGfZpGvLzjVDWpjdTXxALTcpVA64VFqLbb3P7N+zYQ7S9ZucwAz8XQ+wArqszQrLtU3vtz+AsO6dLRxAg0lLjNe084Gv0hFAn8u8HGNqBBZ177sTKoEmL3w0wdwSuxhk1aGIFnlKrzjFY57HvJlxSNupAeXqtU9/DNwLyzsnFc1qN4UKJ/hXdb5mtwug+DZy7E0RpJ/jJemfy7RjIAAZCowCLRFBxfRkY3HRaHeaF31mAogkc8FLXFjx2sR95t7GvK1AvJvHdmXs4OxjvgEVl9OI+mWQ9xMqcmjKwx5KuuAcBt8sLK7MJE6iRBwYBQ7eUQrJcYxRMN+w0vhznvLZwv8=
|
||||
# Save build artifacts.
|
||||
skip_cleanup: true
|
||||
# Using a shell variable in deploy.file is undocumented but seems to work.
|
||||
file:
|
||||
- macosx/${TRAVIS_TAG}.pkg
|
||||
- macosx/${TRAVIS_TAG}-build-report.tbz
|
||||
on:
|
||||
repo: cgull/mosh
|
||||
tags: true
|
||||
condition: ${TRAVIS_OS_NAME} = osx
|
||||
|
||||
notifications:
|
||||
irc:
|
||||
|
||||
Reference in New Issue
Block a user