Procházet zdrojové kódy

ci: migrate to azure pipelines

Stéphane Lepin před 5 roky
rodič
revize
86fbdb6e57

+ 0 - 27
.travis.yml

@@ -1,27 +0,0 @@
-language: cpp
-
-global:
-  env:
-    - PROJECT_NAME="obs-plugintemplate"
-
-matrix:
-  include:
-  - os: linux
-    dist: trusty
-    sudo: required
-    services:
-    - docker
-    before_install:
-    - docker run -d --name xenial -v $(pwd):/repo -v /home/travis/package:/package -e TRAVIS_BRANCH="$TRAVIS_BRANCH" -e TRAVIS_TAG="$TRAVIS_TAG" -e PROJECT_NAME="$PROJECT_NAME" -w /repo nimmis/ubuntu:16.04
-    - docker exec -it xenial /repo/CI/linux/install-dependencies-xenial.sh
-    script:
-    - docker exec -it xenial /repo/CI/linux/build-xenial.sh
-    after_success:
-    - docker exec -it xenial /repo/CI/linux/package-xenial.sh
-
-  - os: osx
-    osx_image: xcode8.3
-    before_install: "./CI/macos/install-dependencies-macos.sh"
-    script: "./CI/macos/build-macos.sh"
-    after_success:
-    - ./CI/macos/package-macos.sh

+ 0 - 0
CI/linux/build-xenial.sh → CI/linux/build-ubuntu.sh


+ 19 - 0
CI/linux/install-dependencies-ubuntu.sh

@@ -0,0 +1,19 @@
+#!/bin/sh
+set -ex
+
+sudo add-apt-repository -y ppa:obsproject/obs-studio
+sudo apt-get -qq update
+
+sudo apt-get install -y \
+	libc-dev-bin \
+	libc6-dev git \
+	build-essential \
+	checkinstall \
+	cmake \
+	obs-studio \
+	qtbase5-dev
+
+# Dirty hack
+sudo wget -O /usr/include/obs/obs-frontend-api.h https://raw.githubusercontent.com/obsproject/obs-studio/25.0.0/UI/obs-frontend-api/obs-frontend-api.h
+
+sudo ldconfig

+ 0 - 19
CI/linux/install-dependencies-xenial.sh

@@ -1,19 +0,0 @@
-#!/bin/sh
-set -ex
-
-add-apt-repository -y ppa:obsproject/obs-studio
-apt-get -qq update
-
-apt-get install -y \
-	libc-dev-bin \
-	libc6-dev git \
-	build-essential \
-	checkinstall \
-	cmake \
-	obs-studio \
-    qtbase5-dev
-
-# Dirty hack
-wget -O /usr/include/obs/obs-frontend-api.h https://raw.githubusercontent.com/obsproject/obs-studio/master/UI/obs-frontend-api/obs-frontend-api.h
-
-ldconfig

+ 0 - 22
CI/linux/package-xenial.sh

@@ -1,22 +0,0 @@
-#!/bin/sh
-
-set -e
-
-export GIT_HASH=$(git rev-parse --short HEAD)
-export PKG_VERSION="1-$GIT_HASH-$TRAVIS_BRANCH-git"
-
-if [ -n "${TRAVIS_TAG}" ]; then
-	export PKG_VERSION="$TRAVIS_TAG"
-fi
-
-cd build
-
-PAGER=cat checkinstall -y --type=debian --fstrans=no --nodoc \
-	--backup=no --deldoc=yes --install=no \
-	--pkgname=$PROJECT_NAME --pkgversion="$PKG_VERSION" \
-	--pkglicense="GPLv2.0" --maintainer="developer@change.me" \
-	--pkggroup="general" \
-	--pkgsource="https://www.mywebsite.com" \
-	--pakdir="/package"
-
-chmod ao+r /package/*

+ 24 - 7
CI/macos/build-macos.sh

@@ -1,11 +1,28 @@
 #!/bin/sh
-set -ex
 
-mkdir build && cd build
+OSTYPE=$(uname)
+
+if [ "${OSTYPE}" != "Darwin" ]; then
+    echo "[Error] macOS build script can be run on Darwin-type OS only."
+    exit 1
+fi
+
+HAS_CMAKE=$(type cmake 2>/dev/null)
+
+if [ "${HAS_CMAKE}" = "" ]; then
+    echo "[Error] CMake not installed - please run 'install-dependencies-macos.sh' first."
+    exit 1
+fi
+
+#export QT_PREFIX="$(find /usr/local/Cellar/qt5 -d 1 | tail -n 1)"
+
+echo "=> Building plugin for macOS."
+mkdir -p build && cd build
 cmake .. \
-  -DQTDIR=/usr/local/opt/qt \
-  -DLIBOBS_INCLUDE_DIR=../../obs-studio/libobs \
-  -DLIBOBS_LIB=../../obs-studio/libobs \
-  -DOBS_FRONTEND_LIB="$(pwd)/../../obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" \
-  -DCMAKE_INSTALL_PREFIX=/usr \
+	-DQTDIR=/usr/local/opt/qt \
+	-DLIBOBS_INCLUDE_DIR=../../obs-studio/libobs \
+	-DLIBOBS_LIB=../../obs-studio/libobs \
+	-DOBS_FRONTEND_LIB="$(pwd)/../../obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" \
+	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
+	-DCMAKE_INSTALL_PREFIX=/usr \
 && make -j4

+ 59 - 23
CI/macos/install-dependencies-macos.sh

@@ -1,26 +1,62 @@
 #!/bin/sh
-set -ex
+
+
+
+OSTYPE=$(uname)
+
+if [ "${OSTYPE}" != "Darwin" ]; then
+    echo "[Error] macOS install dependencies script can be run on Darwin-type OS only."
+    exit 1
+fi
+
+HAS_BREW=$(type brew 2>/dev/null)
+
+if [ "${HAS_BREW}" = "" ]; then
+    echo "[Error] Please install Homebrew (https://www.brew.sh/) to build this plugin on macOS."
+    exit 1
+fi
 
 # OBS Studio deps
-brew update
-brew install ffmpeg
-brew install libav
-
-# qt 5.9.2
-brew install ./CI/macos/qt.rb
-
-# Build obs-studio
-cd ..
-git clone --recursive https://github.com/jp9000/obs-studio
-cd obs-studio
-git checkout 21.0.0
-mkdir build && cd build
-cmake .. \
-  -DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake \
-&& make -j4
-
-# Packages app
-cd ..
-curl -L -O  http://s.sudre.free.fr/Software/files/Packages.dmg -f --retry 5 -C -
-hdiutil attach ./Packages.dmg
-sudo installer -pkg /Volumes/Packages\ 1.2.2/packages/Packages.pkg -target /
+echo "=> Updating Homebrew.."
+brew update >/dev/null
+
+echo "[=> Checking installed Homebrew formulas.."
+BREW_PACKAGES=$(brew list)
+BREW_DEPENDENCIES="jack speexdsp ccache swig mbedtls"
+
+for DEPENDENCY in ${BREW_DEPENDENCIES}; do
+    if echo "${BREW_PACKAGES}" | grep -q "^${DEPENDENCY}\$"; then
+        echo "=> Upgrading OBS-Studio dependency '${DEPENDENCY}'.."
+        brew upgrade ${DEPENDENCY} 2>/dev/null
+    else
+        echo "=> Installing OBS-Studio dependency '${DEPENDENCY}'.."
+        brew install ${DEPENDENCY} 2>/dev/null
+    fi
+done
+
+# qtwebsockets deps
+echo "=> Installing plugin dependency 'QT 5.10.1'.."
+# =!= NOTICE =!=
+# When building QT5 from sources on macOS 10.13+, use local qt5 formula:
+# brew install ./CI/macos/qt.rb
+# Pouring from the bottle is much quicker though, so use bottle for now.
+# =!= NOTICE =!=
+
+brew install https://gist.githubusercontent.com/DDRBoxman/b3956fab6073335a4bf151db0dcbd4ad/raw/ed1342a8a86793ea8c10d8b4d712a654da121ace/qt.rb
+
+# Pin this version of QT5 to avoid `brew upgrade`
+# upgrading it to incompatible version
+brew pin qt
+
+# Fetch and install Packages app
+# =!= NOTICE =!=
+# Installs a LaunchDaemon under /Library/LaunchDaemons/fr.whitebox.packages.build.dispatcher.plist
+# =!= NOTICE =!=
+
+HAS_PACKAGES=$(type packagesbuild 2>/dev/null)
+
+if [ "${HAS_PACKAGES}" = "" ]; then
+    echo "=> Installing Packaging app (might require password due to 'sudo').."
+    curl -o './Packages.pkg' --retry-connrefused -s --retry-delay 1 'https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg'
+    sudo installer -pkg ./Packages.pkg -target /
+fi

+ 79 - 23
CI/macos/package-macos.sh

@@ -1,36 +1,92 @@
-#!/bin/sh
+#!/bin/bash
 
 set -e
 
-echo "-- Preparing package build"
-export QT_CELLAR_PREFIX="$(find /usr/local/Cellar/qt -d 1 | tail -n 1)"
+source ../ci_config.inc.sh
 
-export GIT_HASH=$(git rev-parse --short HEAD)
+OSTYPE=$(uname)
 
-export VERSION="$GIT_HASH-$TRAVIS_BRANCH"
-export LATEST_VERSION="$TRAVIS_BRANCH"
-if [ -n "${TRAVIS_TAG}" ]; then
-	export VERSION="$TRAVIS_TAG"
-	export LATEST_VERSION="$TRAVIS_TAG"
+if [ "${OSTYPE}" != "Darwin" ]; then
+    echo "[Error] macOS package script can be run on Darwin-type OS only."
+    exit 1
 fi
 
-export FILENAME="$PROJECT_NAME-$VERSION.pkg"
-export LATEST_FILENAME="$PROJECT_NAME-latest-$LATEST_VERSION.pkg"
+echo "=> Preparing package build"
+export QT_CELLAR_PREFIX="$(/usr/bin/find /usr/local/Cellar/qt -d 1 | sort -t '.' -k 1,1n -k 2,2n -k 3,3n | tail -n 1)"
 
-echo "-- Modifying $PROJECT_NAME.so"
+GIT_HASH=$(git rev-parse --short HEAD)
+GIT_BRANCH_OR_TAG=$(git name-rev --name-only HEAD | awk -F/ '{print $NF}')
+
+PKG_VERSION="$GIT_HASH-$GIT_BRANCH_OR_TAG"
+
+FILENAME_UNSIGNED="$PLUGIN_NAME-$PKG_VERSION-Unsigned.pkg"
+FILENAME="$PLUGIN_NAME-$PKG_VERSION.pkg"
+
+echo "=> Modifying $PLUGIN_NAME.so"
 install_name_tool \
-	-change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @rpath/QtWidgets \
-	-change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @rpath/QtGui \
-	-change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @rpath/QtCore \
-	./build/$PROJECT_NAME.so
+	-change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets \
+		@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets \
+	-change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui \
+		@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui \
+	-change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore \
+		@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore \
+	./build/$PLUGIN_NAME.so
 
 # Check if replacement worked
-echo "-- Dependencies for obs-websocket"
-otool -L ./build/obs-websocket.so
+echo "=> Dependencies for $PLUGIN_NAME"
+otool -L ./build/$PLUGIN_NAME.so
+
+if [[ "$RELEASE_MODE" == "True" ]]; then
+	echo "=> Signing plugin binary: $PLUGIN_NAME.so"
+	codesign --sign "$CODE_SIGNING_IDENTITY" ./build/$PLUGIN_NAME.so
+else
+	echo "=> Skipped plugin codesigning"
+fi
+
+echo "=> Actual package build"
+packagesbuild ./CI/macos/installer-macOS.pkgproj
+
+echo "=> Renaming $PLUGIN_NAME.pkg to $FILENAME"
+mv ./release/$PLUGIN_NAME.pkg ./release/$FILENAME_UNSIGNED
+
+if [[ "$RELEASE_MODE" == "True" ]]; then
+	echo "=> Signing installer: $FILENAME"
+	productsign \
+		--sign "$INSTALLER_SIGNING_IDENTITY" \
+		./release/$FILENAME_UNSIGNED \
+		./release/$FILENAME
+	rm ./release/$FILENAME_UNSIGNED
+
+	echo "=> Submitting installer $FILENAME for notarization"
+	zip -r ./release/$FILENAME.zip ./release/$FILENAME
+	UPLOAD_RESULT=$(xcrun altool \
+		--notarize-app \
+		--primary-bundle-id "$MACOS_BUNDLEID" \
+		--username "$AC_USERNAME" \
+		--password "$AC_PASSWORD" \
+		--asc-provider "$AC_PROVIDER_SHORTNAME" \
+		--file "./release/$FILENAME.zip")
+	rm ./release/$FILENAME.zip
+
+	REQUEST_UUID=$(echo $UPLOAD_RESULT | awk -F ' = ' '/RequestUUID/ {print $2}')
+	echo "Request UUID: $REQUEST_UUID"
 
-echo "-- Actual package build"
-packagesbuild ./CI/installer/installer-macOS.pkgproj
+	echo "=> Wait for notarization result"
+	# Pieces of code borrowed from rednoah/notarized-app
+	while sleep 30 && date; do
+		CHECK_RESULT=$(xcrun altool \
+			--notarization-info "$REQUEST_UUID" \
+			--username "$AC_USERNAME" \
+			--password "$AC_PASSWORD" \
+			--asc-provider "$AC_PROVIDER_SHORTNAME")
+		echo $CHECK_RESULT
 
-echo "-- Renaming $PROJECT_NAME.pkg to $FILENAME"
-mv ./release/$PROJECT_NAME.pkg ./release/$FILENAME
-cp ./release/$FILENAME ./release/$LATEST_FILENAME
+		if ! grep -q "Status: in progress" <<< "$CHECK_RESULT"; then
+			echo "=> Staple ticket to installer: $FILENAME"
+			xcrun stapler staple ./release/$FILENAME
+			break
+		fi
+	done
+else
+	echo "=> Skipped installer codesigning and notarization"
+fi

+ 1 - 1
CI/macos/qt.rb

@@ -160,4 +160,4 @@ class Qt < Formula
 		assert_predicate testpath/"main.o", :exist?
 		system "./hello"
 	end
-end
+end

+ 0 - 118
CI/win/install-build-obs.cmd

@@ -1,118 +0,0 @@
-@echo off
-SETLOCAL EnableDelayedExpansion
-
-REM Check if obs-studio build exists.
-REM If the obs-studio directory does exist, check if the last OBS tag built
-REM matches the latest OBS tag.
-REM If the tags match, do not build obs-studio.
-REM If the tags do not match, build obs-studio.
-REM If the obs-studio directory doesn't exist, build obs-studio.
-echo Checking for obs-studio build...
-
-set OBSLatestTagPrePull=0
-set OBSLatestTagPostPull=0
-echo Latest tag pre-pull: %OBSLatestTagPrePull%
-echo Latest tag post-pull: %OBSLatestTagPostPull%
-
-REM Set up the build flag as undefined.
-set "BuildOBS="
-
-REM Check the last tag successfully built by CI.
-if exist C:\projects\obs-studio-last-tag-built.txt (
-  set /p OBSLastTagBuilt=<C:\projects\obs-studio-last-tag-built.txt
-) else (
-  set OBSLastTagBuilt=0
-)
-
-REM If obs-studio directory exists, run git pull and get the latest tag number.
-if exist C:\projects\obs-studio\ (
-  echo obs-studio directory exists
-  echo   Updating tag info
-  cd C:\projects\obs-studio\
-  git describe --tags --abbrev=0 > C:\projects\latest-obs-studio-tag-pre-pull.txt
-  set /p OBSLatestTagPrePull=<C:\projects\latest-obs-studio-tag-pre-pull.txt
-  git checkout master
-  git pull
-  git describe --tags --abbrev=0 > C:\projects\latest-obs-studio-tag-post-pull.txt
-  set /p OBSLatestTagPostPull=<C:\projects\latest-obs-studio-tag-post-pull.txt
-  set /p OBSLatestTag=<C:\projects\latest-obs-studio-tag-post-pull.txt
-  echo %OBSLatestTagPostPull%> C:\projects\latest-obs-studio-tag.txt
-)
-
-REM Check the obs-studio tags for mismatches.
-REM If a new tag was pulled, set the build flag.
-if not %OBSLatestTagPrePull%==%OBSLatestTagPostPull% (
-  echo Latest tag pre-pull: %OBSLatestTagPrePull%
-  echo Latest tag post-pull: %OBSLatestTagPostPull%
-  echo Tags do not match.  Need to rebuild OBS.
-  set BuildOBS=true
-)
-
-REM If the latest git tag doesn't match the last built tag, set the build flag.
-if not %OBSLatestTagPostPull%==%OBSLastTagBuilt% (
-  echo Last built OBS tag: %OBSLastTagBuilt%
-  echo Latest tag post-pull: %OBSLatestTagPostPull%
-  echo Tags do not match.  Need to rebuild OBS.
-  set BuildOBS=true
-)
-
-REM If obs-studio directory does not exist, clone the git repo, get the latest
-REM tag number, and set the build flag.
-if not exist C:\projects\obs-studio (
-  echo obs-studio directory does not exist
-  git clone --recursive https://github.com/obsproject/obs-studio
-  cd C:\projects\obs-studio\
-  git describe --tags --abbrev=0 > C:\projects\obs-studio-latest-tag.txt
-  set /p OBSLatestTag=<C:\projects\obs-studio-latest-tag.txt
-  set BuildOBS=true
-)
-
-REM Some debug info
-echo:
-echo Latest tag pre-pull: %OBSLatestTagPrePull%
-echo Latest tag post-pull: %OBSLatestTagPostPull%
-echo Latest tag: %OBSLatestTag%
-echo Last built OBS tag: %OBSLastTagBuilt%
-
-if defined BuildOBS (
-  echo BuildOBS: true
-) else (
-  echo BuildOBS: false
-)
-echo:
-
-REM If the build flag is set, build obs-studio.
-if defined BuildOBS (
-  echo Building obs-studio...
-  echo   git checkout %OBSLatestTag%
-  git checkout %OBSLatestTag%
-  echo:
-  echo   Removing previous build dirs...
-  if exist build rmdir /s /q C:\projects\obs-studio\build
-  if exist build32 rmdir /s /q C:\projects\obs-studio\build32
-  if exist build64 rmdir /s /q C:\projects\obs-studio\build64
-  echo   Making new build dirs...
-  mkdir build
-  mkdir build32
-  mkdir build64
-  echo   Running cmake for obs-studio %OBSLatestTag% 32-bit...
-  cd ./build32
-  cmake -G "Visual Studio 14 2015" -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
-  echo:
-  echo:
-  echo   Running cmake for obs-studio %OBSLatestTag% 64-bit...
-  cd ../build64
-  cmake -G "Visual Studio 14 2015 Win64" -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
-  echo:
-  echo:
-  echo   Building obs-studio %OBSLatestTag% 32-bit ^(Build Config: %build_config%^)...
-  call msbuild /m /p:Configuration=%build_config% C:\projects\obs-studio\build32\obs-studio.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
-  echo   Building obs-studio %OBSLatestTag% 64-bit ^(Build Config: %build_config%^)...
-  call msbuild /m /p:Configuration=%build_config% C:\projects\obs-studio\build64\obs-studio.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
-  cd ..
-  git describe --tags --abbrev=0 > C:\projects\obs-studio-last-tag-built.txt
-  set /p OBSLastTagBuilt=<C:\projects\obs-studio-last-tag-built.txt
-) else (
-  echo Last OBS tag built is:  %OBSLastTagBuilt%
-  echo No need to rebuild OBS.
-)

+ 0 - 6
CI/win/install-setup-qt.cmd

@@ -1,6 +0,0 @@
-@echo off
-
-REM Set default values to use AppVeyor's built-in Qt.
-set QTDIR32=C:\Qt\5.10.1\msvc2015
-set QTDIR64=C:\Qt\5.10.1\msvc2015_64
-set QTCompileVersion=5.10.1

+ 10 - 2
CMakeLists.txt

@@ -3,6 +3,7 @@ project(obs-plugintemplate VERSION 1.0.0)
 
 set(PLUGIN_AUTHOR "Your Name Here")
 set(MACOS_BUNDLEID "com.example.obs-plugintemplate")
+set(LINUX_MAINTAINER_EMAIL "me@contoso.com")
 
 set(CMAKE_PREFIX_PATH "${QTDIR}")
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -30,17 +31,24 @@ configure_file(
     src/plugin-macros.h.in
     src/plugin-macros.h
 )
-
 configure_file(
     installer/installer-macOS.pkgproj.in
     installer/installer-macOS.pkgproj
 )
-
 configure_file(
     installer/installer-Windows.iss.in
     installer/installer-Windows.iss
 )
 
+configure_file(
+    ci/ci_config.inc.sh.in
+    ci/ci_config.inc.sh
+)
+configure_file(
+    ci/ci_config.inc.cmd.in
+    ci/ci_config.inc.cmd
+)
+
 # --- Platform-independent build settings ---
 add_library(${CMAKE_PROJECT_NAME} MODULE ${PLUGIN_SOURCES} ${PLUGIN_HEADERS})
 

+ 0 - 39
appveyor.yml

@@ -1,39 +0,0 @@
-environment:
-  CURL_VERSION: 7.39.0
-  PROJECT_NAME: "obs-plugintemplate"
-
-install:
-  - git submodule update --init --recursive
-  - cd C:\projects\
-  - if not exist dependencies2015.zip curl -kLO https://obsproject.com/downloads/dependencies2015.zip -f --retry 5 -C -
-  - 7z x dependencies2015.zip -odependencies2015
-  - set DepsPath32=%CD%\dependencies2015\win32
-  - set DepsPath64=%CD%\dependencies2015\win64
-  - call C:\projects\%PROJECT_NAME%\CI\win\install-setup-qt.cmd
-  - set build_config=Release
-  - call C:\projects\%PROJECT_NAME%\CI\win\install-build-obs.cmd
-  - cd C:\projects\%PROJECT_NAME%\
-  - mkdir build32
-  - mkdir build64
-  - cd ./build32
-  - cmake -G "Visual Studio 14 2015" -DQTDIR="%QTDIR32%" -DLibObs_DIR="C:\projects\obs-studio\build32\libobs" -DLIBOBS_INCLUDE_DIR="C:\projects\obs-studio\libobs" -DLIBOBS_LIB="C:\projects\obs-studio\build32\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="C:\projects\obs-studio\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..
-  - cd ../build64
-  - cmake -G "Visual Studio 14 2015 Win64" -DQTDIR="%QTDIR64%" -DLibObs_DIR="C:\projects\obs-studio\build64\libobs" -DLIBOBS_INCLUDE_DIR="C:\projects\obs-studio\libobs" -DLIBOBS_LIB="C:\projects\obs-studio\build64\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="C:\projects\obs-studio\build64\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..
-
-build_script:
-  - call msbuild /m /p:Configuration=%build_config% C:\projects\%PROJECT_NAME%\build32\%PROJECT_NAME%.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
-  - call msbuild /m /p:Configuration=%build_config% C:\projects\%PROJECT_NAME%\build64\%PROJECT_NAME%.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
-
-before_deploy:
-  - 7z a "C:\projects\%PROJECT_NAME%\build.zip" C:\projects\%PROJECT_NAME%\release\*
-
-deploy_script:
-  - ps: Push-AppveyorArtifact "C:\projects\%PROJECT_NAME%\build.zip" -FileName "%PROJECT_NAME%-$(git log --pretty=format:'%h' -n 1)-Windows.zip"
-  - ps: Push-AppveyorArtifact "C:\projects\%PROJECT_NAME%\installer\Output\%PROJECT_NAME%-git-Windows-Installer.exe" -FileName "%APPVEYOR_PROJECT_SLUG%-$(git log --pretty=format:'%h' -n 1)-Windows-Installer.exe"
-
-test: off
-
-cache:
-  - C:\projects\dependencies2015.zip
-  - C:\projects\obs-studio-last-tag-built.txt
-  - C:\projects\obs-studio\

+ 166 - 0
azure-pipelines.yml

@@ -0,0 +1,166 @@
+variables:
+  macosSignAndNotarize: false
+  isReleaseMode: ${{ and(eq(variables['isReleaseMode'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) }}
+
+trigger:
+  branches:
+    include:
+      - master
+  tags:
+    include:
+      - '*'
+
+jobs:
+- job: 'Build_Windows'
+  pool:
+    vmImage: 'windows-2019'
+  variables:
+    build_config: RelWithDebInfo
+    DepsBasePath: 'D:\obsdependencies'
+    DepsPath32: '$(DepsBasePath)\win32'
+    DepsPath64: '$(DepsBasePath)\win64'
+    QtBaseDir: 'D:\QtDep'
+    QTDIR32: '$(QtBaseDir)\5.10.1\msvc2017'
+    QTDIR64: '$(QtBaseDir)\5.10.1\msvc2017_64'
+    OBSPath: 'D:\obs-studio'
+  steps:
+    - checkout: self
+      submodules: true
+
+    - script: ./ci/windows/install-qt-win.cmd
+      displayName: 'Install Qt'
+      env:
+        QtBaseDir: $(QtBaseDir)
+
+    - task: Cache@2
+      displayName: Restore cached OBS Studio dependencies
+      inputs:
+        key: 'obsdeps | "$(Agent.OS)"'
+        restoreKeys: |
+          obsdeps | "$(Agent.OS)"
+        path: $(DepsBasePath)
+
+    - script: ./ci/windows/download-obs-deps.cmd
+      displayName: 'Download OBS Studio dependencies'
+
+    - task: Cache@2
+      displayName: Restore cached OBS Studio builds
+      inputs:
+        key: 'obs | "$(Agent.OS)"'
+        restoreKeys: |
+          obs | "$(Agent.OS)"
+        path: $(OBSPath)
+
+    - script: ./ci/windows/prepare-obs-windows.cmd
+      displayName: 'Checkout & CMake OBS Studio'
+      env:
+        build_config: $(build_config)
+        DepsPath32: $(DepsPath32)
+        DepsPath64: $(DepsPath64)
+        QTDIR32: $(QTDIR32)
+        QTDIR64: $(QTDIR64)
+        OBSPath: $(OBSPath)
+
+    - task: MSBuild@1
+      displayName: 'Build OBS Studio 32-bit'
+      inputs:
+        msbuildArguments: '/m /p:Configuration=$(build_config)'
+        solution: '$(OBSPath)\build32\obs-studio.sln'
+
+    - task: MSBuild@1
+      displayName: 'Build OBS Studio 64-bit'
+      inputs:
+        msbuildArguments: '/m /p:Configuration=$(build_config)'
+        solution: '$(OBSPath)\build64\obs-studio.sln'
+
+    - script: ./ci/windows/prepare-windows.cmd
+      displayName: 'CMake Plugin'
+      env:
+        build_config: $(build_config)
+        QTDIR32: $(QTDIR32)
+        QTDIR64: $(QTDIR64)
+        OBSPath: $(OBSPath)
+
+    - task: MSBuild@1
+      displayName: 'Build Plugin 32-bit'
+      inputs:
+        msbuildArguments: '/m /p:Configuration=$(build_config)'
+        solution: '.\build32\main.sln'
+
+    - task: MSBuild@1
+      displayName: 'Build Plugin 64-bit'
+      inputs:
+        msbuildArguments: '/m /p:Configuration=$(build_config)'
+        solution: '.\build64\main.sln'
+
+    - script: ./ci/windows/package-windows.cmd
+      displayName: 'Package Plugin'
+
+    - task: PublishBuildArtifacts@1
+      displayName: 'Upload package artifacts'
+      inputs:
+        pathtoPublish: './package'
+        artifactName: 'windows_build'
+
+- job: 'Build_Linux'
+  pool:
+    vmImage: 'ubuntu-18.04'
+  variables:
+      BUILD_REASON: $(Build.Reason)
+      BRANCH_SHORT_NAME: $(Build.SourceBranchName)
+      BRANCH_FULL_NAME: $(Build.SourceBranch)
+  steps:
+    - checkout: self
+      submodules: true
+
+    - script: ./ci/linux/install-dependencies-ubuntu.sh
+      displayName: 'Install dependencies'
+
+    - script: ./ci/linux/build-ubuntu.sh
+      displayName: 'Build Plugin'
+
+    - script: ./ci/linux/package-ubuntu.sh
+      displayName: 'Package Plugin'
+
+    - task: PublishBuildArtifacts@1
+      inputs:
+        pathtoPublish: './package'
+        artifactName: 'deb_build'
+
+- job: 'Build_macOS'
+  pool:
+    vmImage: 'macos-10.14'
+  steps:
+    - checkout: self
+      submodules: true
+
+    - script: ./ci/macos/install-dependencies-macos.sh
+      displayName: 'Install dependencies'
+
+    - script: ./ci/macos/install-build-obs-macos.sh
+      displayName: 'Build OBS'
+
+    - script: ./ci/macos/build-macos.sh
+      displayName: 'Build Plugin'
+
+    - task: InstallAppleCertificate@1
+      displayName: 'Install release signing certificates'
+      condition: eq(variables['isReleaseMode'], true)
+      inputs:
+        certSecureFile: 'Certificates.p12'
+        certPwd: $(secrets.macOS.certificatesImportPassword)
+
+    - script: ./ci/macos/package-macos.sh
+      displayName: 'Package Plugin'
+      env:
+        RELEASE_MODE: $(isReleaseMode)
+        CODE_SIGNING_IDENTITY: $(secrets.macOS.codeSigningIdentity)
+        INSTALLER_SIGNING_IDENTITY: $(secrets.macOS.installerSigningIdentity)
+        AC_USERNAME: $(secrets.macOS.notarization.username)
+        AC_PASSWORD: $(secrets.macOS.notarization.password)
+        AC_PROVIDER_SHORTNAME: $(secrets.macOS.notarization.providerShortName)
+
+    - task: PublishBuildArtifacts@1
+      inputs:
+        pathtoPublish: './release'
+        artifactName: 'macos_build'

+ 2 - 0
ci/ci_config.inc.cmd.in

@@ -0,0 +1,2 @@
+set PluginName="@CMAKE_PROJECT_NAME@"
+set PluginVersion="@CMAKE_PROJECT_VERSION@"

+ 4 - 0
ci/ci_config.inc.sh.in

@@ -0,0 +1,4 @@
+PLUGIN_NAME="@CMAKE_PROJECT_NAME@"
+PLUGIN_VERSION="@CMAKE_PROJECT_VERSION@"
+MACOS_BUNDLEID="@MACOS_BUNDLEID@"
+LINUX_MAINTAINER_EMAIL="@LINUX_MAINTAINER_EMAIL@"

+ 24 - 0
ci/linux/package-ubuntu.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+
+set -e
+
+source ../ci_config.inc.sh
+
+export GIT_HASH=$(git rev-parse --short HEAD)
+export PKG_VERSION="1-$GIT_HASH-$BRANCH_SHORT_NAME-git"
+
+if [[ "$BRANCH_FULL_NAME" =~ "^refs/tags/" ]]; then
+	export PKG_VERSION="$BRANCH_SHORT_NAME"
+fi
+
+cd ./build
+
+PAGER="cat" sudo checkinstall -y --type=debian --fstrans=no --nodoc \
+	--backup=no --deldoc=yes --install=no \
+	--pkgname="$PLUGIN_NAME" --pkgversion="$PKG_VERSION" \
+	--pkglicense="GPLv2.0" --maintainer="$LINUX_MAINTAINER_EMAIL" \
+	--pkggroup="video" \
+	--requires="obs-studio \(\>= 25.0.7\), libqt5core5a, libqt5widgets5, qt5-image-formats-plugins" \
+	--pakdir="../package"
+
+sudo chmod ao+r ../package/*

+ 43 - 0
ci/macos/install-build-obs-macos.sh

@@ -0,0 +1,43 @@
+#!/bin/sh
+
+OSTYPE=$(uname)
+
+if [ "${OSTYPE}" != "Darwin" ]; then
+    echo "[Error] macOS obs-studio build script can be run on Darwin-type OS only."
+    exit 1
+fi
+
+HAS_CMAKE=$(type cmake 2>/dev/null)
+HAS_GIT=$(type git 2>/dev/null)
+
+if [ "${HAS_CMAKE}" = "" ]; then
+    echo "[Error] CMake not installed - please run 'install-dependencies-macos.sh' first."
+    exit 1
+fi
+
+if [ "${HAS_GIT}" = "" ]; then
+    echo "[Error] Git not installed - please install Xcode developer tools or via Homebrew."
+    exit 1
+fi
+
+echo "=> Downloading and unpacking OBS dependencies"
+wget --quiet --retry-connrefused --waitretry=1 https://obs-nightly.s3.amazonaws.com/osx-deps-2018-08-09.tar.gz
+tar -xf ./osx-deps-2018-08-09.tar.gz -C /tmp
+
+# Build obs-studio
+cd ..
+echo "=> Cloning obs-studio from GitHub.."
+git clone https://github.com/obsproject/obs-studio
+cd obs-studio
+OBSLatestTag=$(git describe --tags --abbrev=0)
+git checkout $OBSLatestTag
+mkdir build && cd build
+echo "=> Building obs-studio.."
+cmake .. \
+	-DBUILD_CAPTIONS=true \
+	-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \
+	-DDISABLE_PLUGINS=true \
+    -DENABLE_SCRIPTING=0 \
+	-DDepsPath=/tmp/obsdeps \
+	-DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake \
+&& make -j4

+ 6 - 0
ci/windows/download-obs-deps.cmd

@@ -0,0 +1,6 @@
+if not exist %DepsBasePath% (
+    curl -o %DepsBasePath%.zip -kLO https://obsproject.com/downloads/dependencies2017.zip -f --retry 5 -C -
+    7z x %DepsBasePath%.zip -o%DepsBasePath%
+) else (
+    echo "OBS dependencies are already there. Download skipped."
+)

+ 8 - 0
ci/windows/install-qt-win.cmd

@@ -0,0 +1,8 @@
+if not exist %QtBaseDir% (
+	curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_5.10.1.7z -f --retry 5 -z Qt_5.10.1.7z
+    7z x Qt_5.10.1.7z -o%QtBaseDir%
+) else (
+	echo "Qt is already installed. Download skipped."
+)
+
+dir %QtBaseDir%

+ 14 - 0
ci/windows/package-windows.cmd

@@ -0,0 +1,14 @@
+mkdir package
+cd package
+
+call ..\ci_config.inc.cmd
+
+git rev-parse --short HEAD > package-version.txt
+set /p PackageVersion=<package-version.txt
+del package-version.txt
+
+REM Package ZIP archive
+7z a "%PluginName%-%PackageVersion%-Windows.zip" "..\release\*"
+
+REM Build installer
+iscc ..\installer\installer-Windows.iss /O. /F"%PluginName%-%PackageVersion%-Windows-Installer"

+ 33 - 0
ci/windows/prepare-obs-windows.cmd

@@ -0,0 +1,33 @@
+@echo off
+SETLOCAL EnableDelayedExpansion
+
+REM If obs-studio directory does not exist, clone the git repo
+if not exist %OBSPath% (
+	echo obs-studio directory does not exist
+	git clone https://github.com/obsproject/obs-studio %OBSPath%
+	cd /D %OBSPath%\
+	git describe --tags --abbrev=0 --exclude="*-rc*" > "%OBSPath%\obs-studio-latest-tag.txt"
+    set /p OBSLatestTag=<"%OBSPath%\obs-studio-latest-tag.txt"
+)
+
+REM Prepare OBS Studio builds
+
+echo Building obs-studio...
+cd /D %OBSPath%
+echo   git checkout %OBSLatestTag%
+git checkout %OBSLatestTag%
+echo:
+
+echo   Running cmake for obs-studio %OBSLatestTag% 32-bit...
+cd build32
+cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -DDepsPath="%DepsPath32%" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
+echo:
+echo:
+
+echo   Running cmake for obs-studio %OBSLatestTag% 64-bit...
+cd ..\build64
+cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -DDepsPath="%DepsPath64%" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
+echo:
+echo:
+
+dir "%OBSPath%\libobs"

+ 14 - 0
ci/windows/prepare-windows.cmd

@@ -0,0 +1,14 @@
+mkdir build32
+mkdir build64
+
+call ..\ci_config.inc.cmd
+
+cd build32
+cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -DLibObs_DIR="%OBSPath%\build32\libobs" -DLIBOBS_INCLUDE_DIR="%OBSPath%\libobs" -DLIBOBS_LIB="%OBSPath%\build32\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="%OBSPath%\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..
+cd ..\build64
+cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -DLibObs_DIR="%OBSPath%\build64\libobs" -DLIBOBS_INCLUDE_DIR="%OBSPath%\libobs" -DLIBOBS_LIB="%OBSPath%\build64\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="%OBSPath%\build64\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..
+
+REM Rename the main project file to something CI can pick up independently of the project's name
+cd ..
+ren "build32\%PluginName%.sln" "build32\main.sln"
+ren "build64\%PluginName%.sln" "build64\main.sln"