-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathazure-pipelines.yml
161 lines (141 loc) · 5 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# This is the build name, which shows in Azure DevOps and is stamped into the built assemblies
name: '$(versionBase).$(buildNumber)'
trigger:
branches:
include:
- master
- validate/*
paths:
exclude:
- doc/
- '*.md'
- .vscode/
variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
#codecov_token: # Get a new one from https://codecov.io/
#ci_feed: # find guid used by Azure DevOps Artifacts for the feed
NUGET_PACKAGES: $(Agent.TempDirectory)/.nuget/packages
xcodeRoot: /Applications/Xcode_11.app
nugetVersion: '5.2.0'
buildNumber: $[counter('buildNumberCounter', 1)]
versionBase: '0.2.0'
releaseVersion: $(versionBase)
prereleaseVersion: $(versionBase)-beta.$(buildNumber)
jobs:
- job: macOS
pool:
vmImage: macOS 10.14
steps:
- checkout: self
clean: true
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 3.0.100
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: /bin/bash -c "sudo xcode-select -s /Applications/Xcode_11.app/Contents/Developer"
displayName: 'Select Xcode version'
enabled: true
# To manually select a Xamarin SDK version on the Microsoft-hosted macOS agent,
# configure this task with the *Mono* version that is associated with the
# Xamarin SDK version that you need, and set the "enabled" property to true.
# See https://go.microsoft.com/fwlink/?linkid=871629
- script: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_4_0
displayName: 'Select the Xamarin SDK version'
enabled: true
- task: MSBuild@1
inputs:
solution: 'src/**/*iOS.csproj'
configuration: 'Release'
msbuildArguments: /t:Restore,Build
- task: CopyFiles@2
displayName: 'Copy build to artifact staging'
inputs:
Contents: |
src/SkiaRenderer/XGraphics.SkiaRenderer.iOS/bin/**/*.dll
src/SkiaRenderer/XGraphics.SkiaRenderer.iOS/bin/**/*.pdb
src/SkiaRenderer/XGraphics.SkiaRenderer.iOS/bin/**/*.mdb
src/XamarinForms/XGraphics.XamarinForms.iOS/bin/**/*.dll
src/XamarinForms/XGraphics.XamarinForms.iOS/bin/**/*.pdb
src/XamarinForms/XGraphics.XamarinForms.iOS/bin/**/*.mdb
TargetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: MacBuild'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: MacBuild
- job: Windows
dependsOn:
- macOS
pool:
vmImage: windows-2019
steps:
- checkout: self
clean: true
- task: NuGetToolInstaller@0
displayName: 'Use NuGet $(nugetVersion)'
inputs:
versionSpec: $(nugetVersion)
- task: DownloadBuildArtifacts@0
displayName: 'Download build artifact MacBuild'
inputs:
artifactName: 'MacBuild'
downloadPath: '$(Build.ArtifactsDirectory)'
- task: CopyFiles@2
displayName: 'Copy MacBuild files to: $(System.DefaultWorkingDirectory)'
inputs:
SourceFolder: '$(Build.ArtifactsDirectory)/MacBuild'
TargetFolder: '$(System.DefaultWorkingDirectory)'
- task: MSBuild@1
displayName: 'Build all non-iOS projects'
inputs:
solution: XGraphics.sln
configuration: 'CIBuild'
msbuildArguments: /p:JavaSdkDirectory="$(JAVA_HOME_8_X64)" /t:Restore,Build
- powershell: |
Write-Host("Update nuspecs")
mkdir ./nuspec-prerelease
mkdir ./nuspec-release
Get-ChildItem './nuspec/*.nuspec' | Foreach-Object {
(Get-Content $_) | Foreach-Object {
$_ -replace '\$version\$', $env:PRERELEASE_VERSION `
} | Set-Content -Path (Join-Path 'nuspec-prerelease' $_.Name)
}
Get-ChildItem './nuspec/*.nuspec' | Foreach-Object {
(Get-Content $_) | Foreach-Object {
$_ -replace '\$version\$', $env:RELEASE_VERSION `
} | Set-Content -Path (Join-Path 'nuspec-release' $_.Name)
}
failOnStderr: true
displayName: 'Update nuspecs'
env:
PRERELEASE_VERSION: '$(prereleaseVersion)'
RELEASE_VERSION: '$(releaseVersion)'
- task: NuGetCommand@2
displayName: 'Make NuGet Package - Prerelease'
inputs:
command: pack
feedsToUse: config
packagesToPack: 'nuspec-prerelease/*.nuspec'
packDestination: '$(Build.ArtifactStagingDirectory)/nuget/prerelease'
- task: NuGetCommand@2
displayName: 'Make NuGet Package - Release'
inputs:
command: pack
feedsToUse: config
packagesToPack: 'nuspec-release/*.nuspec'
packDestination: '$(Build.ArtifactStagingDirectory)/nuget/release'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: nuget'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/nuget'
ArtifactName: nuget
# Publish to our CI NuGet feed (Azure Artifacts)
- task: NuGetCommand@2
displayName: 'Publish prerelease NuGet to CI feed'
inputs:
command: push
publishVstsFeed: 'ci-feed'
packagesToPush: '$(Build.ArtifactStagingDirectory)/nuget/prerelease/*.nupkg'
allowPackageConflicts: false