From 9806004b72306c57ae92240a44854ad23565a2c0 Mon Sep 17 00:00:00 2001 From: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Date: Sun, 9 Jun 2019 11:31:47 -0700 Subject: [PATCH] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 89 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 72 insertions(+), 17 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ac58c25..f21cfe7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,27 +1,82 @@ -# Xamarin.Android -# Build a Xamarin.Android project. -# Add steps that test, sign, and distribute an app, save build artifacts, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/xamarin - -trigger: -- master - pool: - vmImage: 'macos-latest' + name: Hosted VS2017 + demands: + - msbuild + - visualstudio + - MSBuild + - Xamarin.Android + - vstest -variables: - buildConfiguration: 'Release' - outputDirectory: '$(build.binariesDirectory)/$(buildConfiguration)' +#Your build pipeline references an undefined variable named ‘Parameters.solution’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 +#Your build pipeline references an undefined variable named ‘Parameters.solution’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 +#Your build pipeline references the ‘BuildPlatform’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 +#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 +#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 +#Your build pipeline references the ‘BuildPlatform’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 +#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 +#Your build pipeline references a secret variable named ‘AppCenterApiToken’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972 +#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 steps: -- task: NuGetToolInstaller@0 +- task: NuGetToolInstaller@1 + displayName: 'Use NuGet' + inputs: + versionSpec: 4.4.1 - task: NuGetCommand@2 + displayName: 'NuGet restore' + inputs: + restoreSolution: '$(Parameters.solution)' + +- task: VSBuild@1 + displayName: 'Build solution **\*.sln' inputs: - restoreSolution: '**/*.sln' + solution: '$(Parameters.solution)' + platform: '$(BuildPlatform)' + configuration: '$(BuildConfiguration)' - task: XamarinAndroid@1 + displayName: 'Build Xamarin.Android project ' + inputs: + projectFile: '**/*Droid.csproj' + configuration: '$(BuildConfiguration)' + msbuildVersionOption: latest + +- task: VSTest@2 + displayName: 'Run Unit Tests' + inputs: + testAssemblyVer2: '**\bin\**\*UnitTests.dll' + searchFolder: '$(Build.SourcesDirectory)' + platform: '$(BuildPlatform)' + configuration: '$(BuildConfiguration)' + +- task: Bash@3 + displayName: 'Submit APK to App Center Test' + inputs: + targetType: filePath + filePath: './$(Build.SourcesDirectory)/Src/SubmitApkToAppCenterTest.sh' + arguments: '$(AppCenterApiToken)' + failOnStderr: true + env: + BuildPath: $(Build.Repository.LocalPath) + NuGetPackagesPath: $(UserProfile)\.nuget\packages + +- task: PublishSymbols@2 + displayName: 'Publish symbols path' + inputs: + SearchPattern: '**\bin\**\*.pdb' + PublishSymbols: false + continueOnError: true + +- task: CopyFiles@2 + displayName: 'Copy Files to: $(build.artifactstagingdirectory)' + inputs: + SourceFolder: '$(system.defaultworkingdirectory)' + Contents: '**\bin\$(BuildConfiguration)\**' + TargetFolder: '$(build.artifactstagingdirectory)' + +- task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: drop' inputs: - projectFile: '**/*droid*.csproj' - outputDirectory: '$(outputDirectory)' - configuration: '$(buildConfiguration)' + PathtoPublish: '$(build.artifactstagingdirectory)' +