forked from SteveSandersonMS/WebWindow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
112 lines (106 loc) · 3.78 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
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
variables:
versionprefix: 0.1.0
jobs:
- job: 'BuildPackage'
strategy:
matrix:
linux:
imageName: 'ubuntu-18.04'
rid: 'linux-x64'
mac:
imageName: 'macos-10.14'
rid: 'osx-x64'
windows:
rid: 'windows-x64'
imageName: 'windows-2019'
pool:
vmImage: $(imageName)
variables:
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 3.0.100
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: CmdLine@2
displayName: 'Install linux dependencies'
condition: eq(variables.rid, 'linux-x64')
inputs:
script: 'sudo apt-get update && sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev'
- task: NuGetCommand@2
displayName: 'NuGet package restore for Windows native packages'
condition: eq(variables.rid, 'windows-x64')
inputs:
command: 'restore'
restoreSolution: 'WebWindow.Native.sln'
feedsToUse: 'select'
- task: VSBuild@1
displayName: 'Build Windows native assets'
condition: eq(variables.rid, 'windows-x64')
inputs:
solution: 'WebWindow.Native.sln'
platform: 'x64'
configuration: 'Debug'
- task: CmdLine@2
displayName: 'Build Linux/macOS native assets'
condition: ne(variables.rid, 'windows-x64')
inputs:
script: 'dotnet build src/WebWindow/WebWindow.csproj /t:BuildNonWindowsNative'
- task: CmdLine@2
condition: eq(variables.rid, 'windows-x64')
displayName: 'Build .js artifact for WebWindow.Blazor.JS'
inputs:
script: 'dotnet build src/WebWindow.Blazor.JS'
- task: CmdLine@2
displayName: 'dotnet pack WebWindow'
inputs:
script: 'dotnet pack -c $(buildConfiguration) src/WebWindow/WebWindow.csproj /p:VersionPrefix=$(versionprefix) /p:VersionSuffix=$(Build.BuildNumber)'
- task: CmdLine@2
condition: eq(variables.rid, 'windows-x64')
displayName: 'dotnet pack WebWindow.Blazor'
inputs:
script: 'dotnet pack -c $(buildConfiguration) src/WebWindow.Blazor/WebWindow.Blazor.csproj /p:VersionPrefix=$(versionprefix) /p:VersionSuffix=$(Build.BuildNumber)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'artifacts'
ArtifactName: 'artifacts-$(rid)'
publishLocation: 'Container'
- job: 'CombinePackages'
dependsOn: 'BuildPackage'
steps:
- task: DownloadBuildArtifacts@0
inputs:
downloadPath: 'artifacts'
artifactName: 'artifacts-windows-x64'
- task: DownloadBuildArtifacts@0
inputs:
downloadPath: 'artifacts'
artifactName: 'artifacts-linux-x64'
- task: DownloadBuildArtifacts@0
inputs:
downloadPath: 'artifacts'
artifactName: 'artifacts-osx-x64'
- task: CmdLine@2
inputs:
script: 'ls -R artifacts'
- task: CmdLine@2
displayName: 'Merge .nupkg files'
inputs:
script: 'sudo apt install zipmerge && mkdir combined && zipmerge combined/WebWindow.$(versionprefix)-$(Build.BuildNumber).nupkg artifacts/*/WebWindow.$(versionprefix)-$(Build.BuildNumber).nupkg'
- task: CmdLine@2
displayName: 'Copy WebWindow.Blazor nupkg to output'
inputs:
script: 'cp artifacts/artifacts-windows-x64/WebWindow.Blazor.*.nupkg combined/'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'combined'
ArtifactName: 'artifacts-combined'
publishLocation: 'Container'