Browse Source

CI: macOS builds on Azure Pipelines

Colin Edwards 6 years ago
parent
commit
a09ad610af
4 changed files with 63 additions and 16 deletions
  1. 19 15
      CI/before-deploy-osx.sh
  2. 3 1
      CI/install-dependencies-osx.sh
  3. 4 0
      README.rst
  4. 37 0
      azure-pipelines.yml

+ 19 - 15
CI/before-deploy-osx.sh

@@ -9,7 +9,7 @@ set -e
 
 # Generate file name variables
 export GIT_HASH=$(git rev-parse --short HEAD)
-export FILE_DATE=$(date +%Y-%m-%d.%H:%M:%S)
+export FILE_DATE=$(date +%Y-%m-%d.%H-%M-%S)
 export FILENAME=$FILE_DATE-$GIT_HASH-$TRAVIS_BRANCH-osx.pkg
 
 cd ./build
@@ -49,20 +49,24 @@ sudo install_name_tool -change \
 hr "Generating .pkg"
 packagesbuild ../CI/install/osx/CMakeLists.pkgproj
 
-# Signing stuff
-hr "Decrypting Cert"
-openssl aes-256-cbc -K $encrypted_dd3c7f5e9db9_key -iv $encrypted_dd3c7f5e9db9_iv -in ../CI/osxcert/Certificates.p12.enc -out Certificates.p12 -d
-hr "Creating Keychain"
-security create-keychain -p mysecretpassword build.keychain
-security default-keychain -s build.keychain
-security unlock-keychain -p mysecretpassword build.keychain
-security set-keychain-settings -t 3600 -u build.keychain
-hr "Importing certs into keychain"
-security import ./Certificates.p12 -k build.keychain -T /usr/bin/productsign -P ""
-# macOS 10.12+
-security set-key-partition-list -S apple-tool:,apple: -s -k mysecretpassword build.keychain
-hr "Signing Package"
-productsign --sign 2MMRE5MTB8 ./OBS.pkg ./$FILENAME
+if [ -v "$TRAVIS" ]; then
+	# Signing stuff
+	hr "Decrypting Cert"
+	openssl aes-256-cbc -K $encrypted_dd3c7f5e9db9_key -iv $encrypted_dd3c7f5e9db9_iv -in ../CI/osxcert/Certificates.p12.enc -out Certificates.p12 -d
+	hr "Creating Keychain"
+	security create-keychain -p mysecretpassword build.keychain
+	security default-keychain -s build.keychain
+	security unlock-keychain -p mysecretpassword build.keychain
+	security set-keychain-settings -t 3600 -u build.keychain
+	hr "Importing certs into keychain"
+	security import ./Certificates.p12 -k build.keychain -T /usr/bin/productsign -P ""
+	# macOS 10.12+
+	security set-key-partition-list -S apple-tool:,apple: -s -k mysecretpassword build.keychain
+	hr "Signing Package"
+	productsign --sign 2MMRE5MTB8 ./OBS.pkg ./$FILENAME
+else
+	cp ./OBS.pkg ./$FILENAME
+fi
 
 # Move to the folder that travis uses to upload artifacts from
 hr "Moving package to nightly folder for distribution"

+ 3 - 1
CI/install-dependencies-osx.sh

@@ -10,7 +10,9 @@ set -e
 # Echo all commands before executing
 set -v
 
-git fetch --unshallow
+if [ -v "$TRAVIS" ]; then
+  git fetch --unshallow
+fi
 
 # Leave obs-studio folder
 cd ../

+ 4 - 0
README.rst

@@ -9,6 +9,10 @@ OBS Studio <https://obsproject.com>
    :alt: OBS Studio Build Status - AppVeyor CI
    :target: https://ci.appveyor.com/project/jp9000/obs-studio/branch/master
 
+.. image:: https://dev.azure.com/obsjim/obsjim/_apis/build/status/obsproject.obs-studio?branchName=master
+  :alt: OBS Studio Build Status - Azure Pipelines
+  :target: https://dev.azure.com/obsjim/obsjim/_build/latest?definitionId=1&branchName=master
+
 .. image:: https://discordapp.com/api/guilds/348973006581923840/widget.png?style=shield
    :alt: OBS Studio Discord Server
    :target: https://obsproject.com/discord

+ 37 - 0
azure-pipelines.yml

@@ -0,0 +1,37 @@
+# Starter pipeline
+# Start with a minimal pipeline that you can customize to build and deploy your code.
+# Add steps that build, run tests, deploy, and more:
+# https://aka.ms/yaml
+
+pool:
+  vmImage: 'macOS-10.13'
+
+variables:
+  CMAKE_PREFIX_PATH: /usr/local/opt/qt5/lib/cmake
+  CEF_BUILD_VERSION: 3.3282.1726.gc8368c8
+
+steps:
+- script: git submodule update --init --recursive
+  displayName: 'Checkout Submodules'
+
+- script: ./CI/install-dependencies-osx.sh
+  displayName: 'Install Dependencies'
+
+- script: ./CI/before-script-osx.sh
+  displayName: 'Cmake'
+
+- bash: |
+    cd ./build
+    make -j4
+    cd -
+  displayName: 'Build'
+
+- script: ./CI/before-deploy-osx.sh
+  condition: ne(variables['Build.Reason'], 'PullRequest')
+  displayName: 'Before Deploy'
+
+- task: PublishBuildArtifacts@1
+  condition: ne(variables['Build.Reason'], 'PullRequest')
+  inputs:
+    pathtoPublish: './nightly'
+    artifactName: build