Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…lingPlugin into dotnet6
  • Loading branch information
jamesmontemagno committed Jan 14, 2022
2 parents a516792 + 9cd7ef6 commit e374dea
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
variables:
CurrentSemanticVersionBase: '6.0.0'
PreviewNumber: $[counter(variables['CurrentSemanticVersionBase'], 1001)]
CurrentSemanticVersion: '$(CurrentSemanticVersionBase)-preview$(PreviewNumber)'
NugetPackageVersion: '$(CurrentSemanticVersion)'
NET_VERSION: '6.0.x'
PathToSolution: 'src/InAppBilling.sln'
PathToCsproj: 'src/Plugin.InAppBilling/Plugin.InAppBilling.csproj'
XcodeVersion: '13.1'

trigger:
branches:
include:
- main
tags:
include:
- '*'
paths:
exclude:
- README.md

pr:
autoCancel: 'true'
branches:
include:
- main
paths:
exclude:
- README.md

jobs:
- job: build_windows
displayName: Build Windows Library
pool:
vmImage: windows-2022
steps:
- task: UseDotNet@2
displayName: 'Install .NET SDK'
inputs:
version: '$(NET_VERSION)'
- task: CmdLine@2
displayName: 'Install .NET MAUI workload'
inputs:
script: 'dotnet workload install maui'
# if this is a tagged build, then update the version number
- powershell: |
$buildSourceBranch = "$(Build.SourceBranch)"
$tagVersion = $buildSourceBranch.Substring($buildSourceBranch.LastIndexOf("/") + 1)
Write-Host("Branch = $buildSourceBranch, Version = $tagVersion");
Write-Host ("##vso[task.setvariable variable=NugetPackageVersion;]$tagVersion")
displayName: Set NuGet Version to Tag Number
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
# if this is a PR build, then update the version number
- powershell: |
$prNumber = $env:System_PullRequest_PullRequestNumber
$commitId = "$($env:System_PullRequest_SourceCommitId)".Substring(0, 7)
$fullVersionString = "$(CurrentSemanticVersionBase)-build-$prNumber.$(Build.BuildId)+$commitId"
Write-Host("GitHub PR = $prNumber, Commit = $commitId");
Write-Host ("##vso[task.setvariable variable=NugetPackageVersion;]$fullVersionString")
Write-Host "##vso[build.updatebuildnumber]$fullVersionString"
displayName: Set NuGet Version to PR Version
condition: and(succeeded(), eq(variables['build.reason'], 'PullRequest'))
# build, test and pack the packages
- task: VSBuild@1
displayName: 'Build Community Toolkit Sample'
inputs:
solution: '$(PathToCsproj)'
configuration: 'Release'
msbuildArgs: '/restore'
- task: VSBuild@1
displayName: 'Build and Pack'
inputs:
solution: '$(PathToCommunityToolkitCoreCsproj)'
configuration: 'Release'
msbuildArgs: '/restore -t:pack -p:PackageVersion=$(NugetPackageVersion) -p:Version=$(NugetPackageVersion) /p:OutputPath=$(Build.ArtifactStagingDirectory)/nuget -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg'
# publish the packages
- task: PublishBuildArtifacts@1
displayName: 'Publish NuGets'
inputs:
artifactName: nuget
pathToPublish: '$(Build.ArtifactStagingDirectory)/nuget'

0 comments on commit e374dea

Please sign in to comment.