From e518694026815d379a0f0ccc9b2cef9968a83a7a Mon Sep 17 00:00:00 2001 From: Nelson Chen Date: Tue, 7 May 2019 00:18:04 -0700 Subject: [PATCH] Initial Azure Pipelines --- .gitignore | 6 ++ README.md | 2 + azure-pipelines.yml | 82 +++++++++++++++++++ azure-pipelines/build_env_tmpl.bat | 6 ++ .../download_install_bonjour_sdk_like.ps1 | 12 +++ azure-pipelines/download_install_qt.ps1 | 25 ++++++ 6 files changed, 133 insertions(+) create mode 100644 azure-pipelines.yml create mode 100644 azure-pipelines/build_env_tmpl.bat create mode 100644 azure-pipelines/download_install_bonjour_sdk_like.ps1 create mode 100644 azure-pipelines/download_install_qt.ps1 diff --git a/.gitignore b/.gitignore index 0a8fe315..feeb09e0 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,9 @@ Makefile **/CMakeFiles/ CMakeCache.txt /rpm +# Visual Studio 2015/2017 cache/options directory +.vs/ +# VS Code Directory +.vscode/ +# Transient in-project-directory dependencies +/deps/ diff --git a/README.md b/README.md index 4f53f98a..0916d453 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Eliminate the barrier between your machines. Master branch build status:   [![Build Status](https://travis-ci.org/debauchee/barrier.svg?branch=master)](https://travis-ci.org/debauchee/barrier) +Azure Pipelines build status: [![Build Status](https://dev.azure.com/debauchee/Barrier/_apis/build/status/debauchee.barrier?branchName=master)](https://dev.azure.com/debauchee/Barrier/_build/latest?definitionId=1&branchName=master) + ### What is it? Barrier is KVM software forked from Symless's synergy 1.9 codebase. Synergy was a commercialized reimplementation of the original CosmoSynergy written by Chris Schoeneman. diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..6c049677 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,82 @@ +trigger: + tags: + include: + - '*' + branches: + include: + - '*' + +jobs: +- job: WinBuild + displayName: Windows Build + pool: + vmImage: 'vs2017-win2016' + strategy: + matrix: + Debug: + CI_ENV_BUILD_TYPE: Debug + Release with Release Installer: + CI_ENV_BUILD_TYPE: Release + steps: + # Gather Dependencies + - task: PowerShell@2 + displayName: Download Bonjour SDK-like + inputs: + filePath: azure-pipelines/download_install_bonjour_sdk_like.ps1 + - task: UsePythonVersion@0 + displayName: Selecting Python Installer for QLI Installer + inputs: + versionSpec: '3.7' + - task: PowerShell@2 + displayName: Installing QT + condition: ne(variables['CacheRestored'], 'true') + inputs: + filePath: azure-pipelines/download_install_qt.ps1 + # Build time! + - powershell: Copy-Item azure-pipelines\build_env_tmpl.bat build_env.bat + displayName: Layering Azure Pipeline's build_env.bat + - script: | + call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\vsdevcmd" -arch=x64 && clean_build.bat + displayName: Clean Build + - task: ArchiveFiles@2 + displayName: Archive Completed Build Directory + inputs: + rootFolderOrFile: build\bin\$(CI_ENV_BUILD_TYPE)\ + includeRootFolder: true + archiveFile: $(Build.ArtifactStagingDirectory)\$(CI_ENV_BUILD_TYPE).zip + - task: PublishBuildArtifacts@1 + displayName: Publish Completed Build Directory Archive Build Artifact + inputs: + pathtoPublish: $(Build.ArtifactStagingDirectory)\$(CI_ENV_BUILD_TYPE).zip + artifactName: $(CI_ENV_BUILD_TYPE) + - script: build_installer.bat + displayName: Build Installer + condition: eq(variables['CI_ENV_BUILD_TYPE'], 'Release') + - task: PublishBuildArtifacts@1 + displayName: Publish Release Installer + condition: eq(variables['CI_ENV_BUILD_TYPE'], 'Release') + inputs: + pathtoPublish: build\installer-inno\bin + artifactName: Release Installer + +- job: LinuxBuild + displayName: Linux Build + pool: + vmImage: 'ubuntu-16.04' + steps: + - script: sudo apt-get install -y libxtst-dev qtdeclarative5-dev libavahi-compat-libdnssd-dev libcurl4-openssl-dev + displayName: Install Dependencies + - script: sh -x ./clean_build.sh + displayName: Clean Build + +- job: MacBuild + displayName: Mac Build + pool: + vmImage: 'macOS-10.14' + steps: + - script: brew update + displayName: Update brew + - script: brew install qt openssl + displayName: Install Dependencies + - script: sh -x ./clean_build.sh + displayName: Clean Build diff --git a/azure-pipelines/build_env_tmpl.bat b/azure-pipelines/build_env_tmpl.bat new file mode 100644 index 00000000..eefa014a --- /dev/null +++ b/azure-pipelines/build_env_tmpl.bat @@ -0,0 +1,6 @@ +set B_BUILD_TYPE=%CI_ENV_BUILD_TYPE% +set B_QT_ROOT=%cd%\deps\Qt +set B_QT_VER=Qt5.12.3\5.12.3 +set B_QT_MSVC=msvc2017_64 +set B_BONJOUR=%cd%\deps\BonjourSDKLike + diff --git a/azure-pipelines/download_install_bonjour_sdk_like.ps1 b/azure-pipelines/download_install_bonjour_sdk_like.ps1 new file mode 100644 index 00000000..97bfa832 --- /dev/null +++ b/azure-pipelines/download_install_bonjour_sdk_like.ps1 @@ -0,0 +1,12 @@ +$ErrorActionPreference = "Stop" + +New-Item -Force -ItemType Directory -Path ".\deps\" +$Wc = New-Object System.Net.WebClient +$Wc.DownloadFile('https://github.com/nelsonjchen/mDNSResponder/releases/download/v2019.05.08.1/x64_RelWithDebInfo.zip', 'deps\BonjourSDKLike.zip') ; +Write-Output 'Downloaded BonjourSDKLike Zip' +Write-Output 'Unzipping BonjourSDKLike Zip' +Remove-Item -Recurse -Force -ErrorAction Ignore .\deps\BonjourSDKLike +Expand-Archive .\deps\BonjourSDKLike.zip -DestinationPath .\deps\BonjourSDKLike +Write-Output 'Installed BonjourSDKLike Zip' +Remove-Item deps\BonjourSDKLike.zip +Write-Output 'Deleted BonjourSDKLike Zip' diff --git a/azure-pipelines/download_install_qt.ps1 b/azure-pipelines/download_install_qt.ps1 new file mode 100644 index 00000000..3fdb619b --- /dev/null +++ b/azure-pipelines/download_install_qt.ps1 @@ -0,0 +1,25 @@ +$ErrorActionPreference = "Stop" + +$qli_install_version = '2019.05.12.4' +$qt_version = '5.12.3' + +New-Item -Force -ItemType Directory -Path ".\deps\" + +Write-Output 'Downloading QLI Installer' +$Wc = New-Object System.Net.WebClient +$Wc.DownloadFile("https://github.com/nelsonjchen/qli-installer/archive/v$qli_install_version.zip", '.\deps\qli-installer.zip') ; +Write-Output 'Downloaded QLI Installer' + +Write-Output 'Extracting QLI Installer' +Expand-Archive deps\qli-installer.zip deps\ +Move-Item .\deps\qli-installer-$qli_install_version\ .\deps\qli-installer +Write-Output 'Extracted QLI Installer' + +Write-Output 'Installing QLI Installer Dependencies' +pip install -r .\deps\qli-installer\requirements.txt +Write-Output 'Installed QLI Installer Dependencies' + +Write-Output 'Starting QT Installer' +$Env:QLI_OUT_DIR = ".\deps\Qt\Qt$qt_version" +python .\deps\qli-installer\qli-installer.py $qt_version windows desktop win64_msvc2017_64 +Write-Output 'Installed QT Installer'