before-deploy-osx.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. hr() {
  2. echo "───────────────────────────────────────────────────"
  3. echo $1
  4. echo "───────────────────────────────────────────────────"
  5. }
  6. # Exit if something fails
  7. set -e
  8. # Generate file name variables
  9. export GIT_HASH=$(git rev-parse --short HEAD)
  10. export FILE_DATE=$(date +%Y-%m-%d.%H:%M:%S)
  11. export FILENAME=$FILE_DATE-$GIT_HASH-$TRAVIS_BRANCH-osx.pkg
  12. cd ./build
  13. # Move the CEF plugin out before running build_app so that it doesn't get packaged twice
  14. hr "Moving CEF out to preserve linking"
  15. mv ./rundir/RelWithDebInfo/obs-plugins/CEF.app ./
  16. mv ./rundir/RelWithDebInfo/obs-plugins/obs-browser.so ./
  17. # Package everything into a nice .app
  18. hr "Packaging .app"
  19. STABLE=false
  20. if [ -n "${TRAVIS_TAG}" ]; then
  21. STABLE=true
  22. fi
  23. sudo python ../CI/install/osx/build_app.py --public-key ../CI/install/osx/OBSPublicDSAKey.pem --sparkle-framework ../../sparkle/Sparkle.framework --base-url "https://obsproject.com/osx_update" --stable=$STABLE
  24. # Move the CEF plugin back to where it belongs
  25. hr "Moving CEF back"
  26. mv ./CEF.app ./rundir/RelWithDebInfo/obs-plugins/
  27. mv ./obs-browser.so ./rundir/RelWithDebInfo/obs-plugins/
  28. # Package app
  29. hr "Generating .pkg"
  30. packagesbuild ../CI/install/osx/CMakeLists.pkgproj
  31. # Signing stuff
  32. hr "Decrypting Cert"
  33. openssl aes-256-cbc -K $encrypted_dd3c7f5e9db9_key -iv $encrypted_dd3c7f5e9db9_iv -in ../CI/osxcert/Certificates.p12.enc -out Certificates.p12 -d
  34. hr "Creating Keychain"
  35. security create-keychain -p mysecretpassword build.keychain
  36. security default-keychain -s build.keychain
  37. security unlock-keychain -p mysecretpassword build.keychain
  38. security set-keychain-settings -t 3600 -u build.keychain
  39. hr "Importing certs into keychain"
  40. security import ./Certificates.p12 -k build.keychain -T /usr/bin/productsign -P ""
  41. hr "Signing Package"
  42. productsign --sign 'Developer ID Installer: Hugh Bailey (2MMRE5MTB8)' ./OBS.pkg ./$FILENAME
  43. # Move to the folder that travis uses to upload artifacts from
  44. hr "Moving package to nightly folder for distribution"
  45. mkdir ../nightly
  46. sudo mv ./$FILENAME ../nightly