2016-04-26 16:49:35 +00:00
|
|
|
language: objective-c
|
2016-08-23 09:36:11 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
2020-07-11 07:30:02 +00:00
|
|
|
- os: osx
|
2021-03-30 08:34:59 +00:00
|
|
|
osx_image: xcode12.2
|
2020-07-11 07:30:02 +00:00
|
|
|
sudo: required
|
|
|
|
env: DEPLOY=true
|
2017-10-10 22:01:05 +00:00
|
|
|
- os: osx
|
2020-02-04 08:27:45 +00:00
|
|
|
osx_image: xcode11.3
|
2018-09-23 08:19:58 +00:00
|
|
|
xcode_sdk: macosx10.14
|
2017-10-10 22:01:05 +00:00
|
|
|
sudo: required
|
2019-08-06 07:24:25 +00:00
|
|
|
- os: osx
|
|
|
|
osx_image: xcode10.1
|
|
|
|
xcode_sdk: macosx10.14
|
|
|
|
sudo: required
|
2017-10-10 22:01:05 +00:00
|
|
|
- os: osx
|
2018-09-23 08:19:58 +00:00
|
|
|
osx_image: xcode9.4
|
|
|
|
xcode_sdk: macosx10.13
|
|
|
|
sudo: required
|
2019-08-06 07:24:25 +00:00
|
|
|
# Fails to compile in 8.3, but it isn't clear from the logs why it fails.
|
|
|
|
# - os: osx
|
|
|
|
# osx_image: xcode8.3
|
|
|
|
# xcode_sdk: macosx10.12
|
|
|
|
# sudo: required
|
2017-05-04 03:59:18 +00:00
|
|
|
# branches:
|
|
|
|
# only:
|
|
|
|
# - master
|
2016-05-10 23:58:26 +00:00
|
|
|
install:
|
2016-08-23 09:36:11 +00:00
|
|
|
# Install Apple's NullAudio device. Travis' VMs don't have any audio devices installed.
|
2016-05-10 23:58:26 +00:00
|
|
|
- sudo xcodebuild -project BGMApp/BGMAppTests/NullAudio/AudioDriverExamples.xcodeproj -target NullAudio DSTROOT="/" install
|
|
|
|
- sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod || sudo killall coreaudiod
|
2016-04-26 16:49:35 +00:00
|
|
|
script:
|
2016-10-06 08:20:17 +00:00
|
|
|
# Build in a case-sensitive disk image to catch failures that only happen on case-sensitive filesystems.
|
2018-06-05 02:01:02 +00:00
|
|
|
- hdiutil create -type SPARSEBUNDLE -fs 'Case-sensitive Journaled HFS+' -volname bgmbuild -nospotlight -verbose -attach -size 100m bgmbuild.dmg
|
2016-10-06 20:41:08 +00:00
|
|
|
- sudo cp -r . /Volumes/bgmbuild
|
2016-10-06 08:20:17 +00:00
|
|
|
- cd /Volumes/bgmbuild
|
2017-02-15 12:49:10 +00:00
|
|
|
# Install Background Music.
|
2016-04-26 16:49:35 +00:00
|
|
|
- yes | ./build_and_install.sh
|
2018-11-17 03:49:25 +00:00
|
|
|
# Print the log file, but put it in a fold because it's so long.
|
|
|
|
- echo -en 'build_and_install.log\ntravis_fold:start:build.log\\r'
|
2016-04-26 16:49:35 +00:00
|
|
|
- cat build_and_install.log
|
2018-11-17 03:49:25 +00:00
|
|
|
- echo -en 'travis_fold:end:build.log\\r'
|
2016-04-26 16:49:35 +00:00
|
|
|
- find */build/Release/*/ -type f -exec md5 {} \;
|
2016-08-23 09:36:11 +00:00
|
|
|
# Log the installed audio devices...
|
2016-05-10 16:11:47 +00:00
|
|
|
- system_profiler SPAudioDataType
|
2016-08-23 09:36:11 +00:00
|
|
|
# ...and their IDs.
|
2016-05-10 16:11:47 +00:00
|
|
|
- say -a '?'
|
2017-02-15 12:49:10 +00:00
|
|
|
# Check the BGM dirs and files were installed. (These fail if the dir/file isn't found.)
|
|
|
|
- ls -la "/Applications/Background Music.app"
|
|
|
|
- ls -la "/Library/Audio/Plug-Ins/HAL/Background Music Device.driver"
|
|
|
|
- ls -la "/usr/local/libexec/BGMXPCHelper.xpc" || ls -la "/Library/Application Support/Background Music/BGMXPCHelper.xpc"
|
|
|
|
- ls -la "/Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist"
|
2016-08-23 09:36:11 +00:00
|
|
|
# Close BGMApp (which the install script opened).
|
2017-10-23 09:01:04 +00:00
|
|
|
#
|
|
|
|
# The killall fallback command is necessary because the AppleScript gets "user canceled" on Travis'
|
|
|
|
# Xcode 9 images for some reason.
|
|
|
|
- osascript -e 'tell application "Background Music" to quit' || killall "Background Music"
|
2017-02-19 09:25:54 +00:00
|
|
|
# Skip the UI tests until Travis has support for them.
|
|
|
|
- BGMApp/BGMAppTests/UITests/travis-skip.py
|
2017-02-15 12:49:10 +00:00
|
|
|
# Run the tests.
|
2018-11-17 03:49:25 +00:00
|
|
|
# The echo commands put the output into a fold in the Travis logs.
|
|
|
|
- echo -en 'Unit Tests\ntravis_fold:start:tests\\r'
|
2016-04-26 16:49:35 +00:00
|
|
|
- xcodebuild -workspace BGM.xcworkspace -scheme 'Background Music Device' test
|
|
|
|
- xcodebuild -workspace BGM.xcworkspace -scheme 'Background Music' test
|
|
|
|
- xcodebuild -workspace BGM.xcworkspace -scheme 'BGMXPCHelper' test
|
2018-11-17 03:49:25 +00:00
|
|
|
- echo -en 'travis_fold:end:tests\\r'
|
2017-02-15 12:49:10 +00:00
|
|
|
# Uninstall Background Music.
|
2016-04-26 16:49:35 +00:00
|
|
|
- yes | ./uninstall.sh
|
2017-02-15 12:49:10 +00:00
|
|
|
# Check the BGM dirs and files were removed.
|
2017-02-15 13:26:04 +00:00
|
|
|
- if ls -la "/Applications/Background Music.app"; then false; fi
|
|
|
|
- if ls -la "/Library/Audio/Plug-Ins/HAL/Background Music Device.driver"; then false; fi
|
|
|
|
- if ls -la "/usr/local/libexec/BGMXPCHelper.xpc"; then false; fi
|
|
|
|
- if ls -la "/Library/Application Support/Background Music/BGMXPCHelper.xpc"; then false; fi
|
|
|
|
- if ls -la "/Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist"; then false; fi
|
2017-06-25 04:04:01 +00:00
|
|
|
# Return early if we're not testing packaging on this OS X version.
|
|
|
|
- if [[ "$PACKAGE" == "false" ]]; then exit 0; fi
|
2018-06-04 14:40:02 +00:00
|
|
|
# Build the .pkg installer. Print the build logs if it fails. If this build is for a tag with
|
|
|
|
# "DEBUG" in its name, build a debug package. (More detailed logging, no optimization, etc.)
|
|
|
|
- if [[ "$TRAVIS_TAG" =~ .*DEBUG.* ]]; then
|
|
|
|
./package.sh -d || (cat build_and_install.log && travis_terminate 1);
|
|
|
|
else
|
|
|
|
./package.sh || (cat build_and_install.log && travis_terminate 1);
|
|
|
|
fi
|
2017-06-11 09:19:31 +00:00
|
|
|
# Install the .pkg.
|
2020-06-22 01:31:00 +00:00
|
|
|
# TODO: Debug packages are failing to install on Travis, but I can't reproduce the problem locally,
|
|
|
|
# so temporarily allow debug builds to pass even if the install fails.
|
|
|
|
- sudo installer -pkg Background-Music-*/BackgroundMusic-*.pkg -target / -verbose -dumplog || [[ "$TRAVIS_TAG" =~ .*DEBUG.* ]]
|
2021-03-30 08:34:59 +00:00
|
|
|
# Print the installer logs. This trims the start of the log to save space.
|
2020-02-09 09:19:41 +00:00
|
|
|
- echo -en '/var/log/install.log\ntravis_fold:start:install.log\\r'
|
2021-03-30 08:34:59 +00:00
|
|
|
- grep -E -A 9999 -B 20 'Background.?Music' /var/log/install.log
|
2020-02-09 09:19:41 +00:00
|
|
|
- echo -en 'travis_fold:end:install.log\\r'
|
2017-06-11 09:19:31 +00:00
|
|
|
# Check the BGM dirs and files were installed again.
|
|
|
|
- ls -la "/Applications/Background Music.app"
|
|
|
|
- ls -la "/Library/Audio/Plug-Ins/HAL/Background Music Device.driver"
|
|
|
|
- ls -la "/usr/local/libexec/BGMXPCHelper.xpc" || ls -la "/Library/Application Support/Background Music/BGMXPCHelper.xpc"
|
|
|
|
- ls -la "/Library/LaunchDaemons/com.bearisdriving.BGM.XPCHelper.plist"
|
2020-06-20 14:12:16 +00:00
|
|
|
# Also deploy (i.e. attach to the GitHub release) the log file from the build package.sh did. If we
|
|
|
|
# just printed it, we'd run out of space and the build would be killed. The release is created as a
|
|
|
|
# draft initially, so we can remove the log file before making the release public.
|
|
|
|
- cp build_and_install.log Background-Music-*
|
2017-02-18 07:12:40 +00:00
|
|
|
# Post on IRC when Travis builds finish.
|
2017-02-15 13:26:04 +00:00
|
|
|
notifications:
|
2017-02-19 04:14:34 +00:00
|
|
|
irc: "irc.freenode.org#backgroundmusic"
|
2020-02-04 08:27:45 +00:00
|
|
|
# Upload the .pkg and archives to GitHub.
|
2017-06-12 03:52:59 +00:00
|
|
|
deploy:
|
|
|
|
provider: releases
|
|
|
|
api_key:
|
|
|
|
secure: j5GdMTkJI/9lfGMcAW4dnBnfNSW0EUGSuaKSXw49FfjfcshLL2RFxIbQkyA7QqjoJm6ohstU3tOCo7c9FrqIWjE/+5itGJpq7NXDRxFtd2qzcli1u+1IRvQUZJ4VYC9982pSS0IUynK9/f0rhbdkWsCuXWIjoClYPBRscc8soDBJvkDbfilPFfFgkc8TuSmtGDCdu9coGVi6b9HuTLNQU0g5DZkjmv71Vj3SwJ2CmvOk3GFfV1SjvG2SRgBDwyP1g9MRGRiNYkmK9lJRgsq2KLluzb04lt22x8RIcZ+kZYOQVmgDlCeWlOcXi0iz1wU/QzdoYFEAnJdG4q0hqKeqIi+p8Tc31nHPuc1ZlYpifzMQ6KuOoOP19eceJwriAT133t2RSB3Rl3nxh9bymNPNyQ2dJwGNFtO68f3aZsuE5L92lVgW/ipZ6e5Sw1ovXldR04mxNtyY4WvFXFlkn/776tKV0vgAubsHfceGM/aRoBj+E2gDvqkFqIR8wrZAZEeSM2reMHPMx5ICFppIZ8dCIVjF5bsxZQsbojY+LXV8BUU5kLAou0yD7Q+lHi9r3HYdN90+cC02HKGFYzsIiMAyf4IAngnLhwmmrLOwr3wWdACjYTJhznAZGNJh4lCeB4dx85iyj3EexJ6J/DL1k2+ZNKyMN3+i/215t+AvSsXuw5U=
|
2017-06-12 04:38:26 +00:00
|
|
|
file_glob: true
|
2017-06-12 03:52:59 +00:00
|
|
|
file: Background-Music-*/*
|
2017-05-04 04:22:25 +00:00
|
|
|
skip_cleanup: true
|
2018-10-06 04:35:57 +00:00
|
|
|
name: $TRAVIS_TAG
|
|
|
|
prerelease: true
|
2019-10-17 01:37:05 +00:00
|
|
|
draft: true
|
2017-06-12 03:52:59 +00:00
|
|
|
on:
|
|
|
|
repo: kyleneideck/BackgroundMusic
|
2017-06-14 03:54:45 +00:00
|
|
|
tags: true
|
|
|
|
# TODO: Use "condition" to build master and tags?
|
2017-05-04 04:22:25 +00:00
|
|
|
condition: $DEPLOY = true
|
2017-06-12 03:52:59 +00:00
|
|
|
|
|
|
|
|