forked from tryphotino/photino.Native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-photino.native-dev.yml
183 lines (152 loc) · 5.78 KB
/
azure-pipelines-photino.native-dev.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Build Photino.Native project from dev branch in GitHub
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- debug
variables:
versionprefix: 0.9.0
jobs:
- job: 'BuildNative'
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
rid: 'linux-x64'
mac:
imageName: 'macos-latest'
rid: 'osx-x64'
windows:
rid: 'windows-x64'
imageName: 'windows-latest'
pool:
vmImage: $(imageName)
variables:
buildConfiguration: 'Release'
steps:
#Install dependencies
- 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 libnotify4 libnotify-dev'
- task: NuGetCommand@2
displayName: 'NuGet package restore for Windows native packages'
condition: eq(variables.rid, 'windows-x64')
inputs:
command: 'restore'
restoreSolution: 'Photino.Native.sln'
feedsToUse: 'select'
#NOTE: Release build configuration should not build Test project - it has linked files and will not build
#- task: DotNetCoreCLI@2
# displayName: dotnet restore
# inputs:
# command: restore
# projects: '**/*.csproj'
#Build
- task: VSBuild@1
displayName: 'Build Windows native assets'
condition: eq(variables.rid, 'windows-x64')
inputs:
solution: 'Photino.Native.sln'
platform: 'x64'
configuration: '$(buildConfiguration)'
- task: CmdLine@2
displayName: 'Create output folder for Linux'
condition: eq(variables.rid, 'linux-x64')
inputs:
workingDirectory: './Photino.Native'
script: 'mkdir x64; cd x64; mkdir $(buildConfiguration)'
- task: CmdLine@2
displayName: 'Build Linux native assets'
condition: eq(variables.rid, 'linux-x64')
inputs:
workingDirectory: './Photino.Native'
script: 'gcc -std=c++11 -shared -DOS_LINUX Exports.cpp Photino.Linux.cpp -o x64/$(buildConfiguration)/Photino.Native.so `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0 libnotify` -fPIC'
- task: CmdLine@2
displayName: 'Create output folder for macOS'
condition: eq(variables.rid, 'osx-x64')
inputs:
workingDirectory: '.'
script: 'mkdir -p ./x64/$(buildConfiguration)'
- task: CmdLine@2
displayName: 'Build macOS native assets'
condition: eq(variables.rid, 'osx-x64')
inputs:
workingDirectory: '.'
script: 'make mac-dev && mv ./lib/dev/Photino.Native.dylib ./x64/$(buildConfiguration)/Photino.Native.dylib'
#Publish native output to Artifacts
- task: PublishPipelineArtifact@1
displayName: 'Publish Photino.Native.dll (windows) to artifacts'
condition: eq(variables.rid, 'windows-x64')
inputs:
targetPath: './Photino.Native/x64/$(buildConfiguration)/Photino.Native.dll'
artifactName: 'Photino.Native.dll'
- task: PublishPipelineArtifact@1
displayName: 'Publish WebView2Loader.dll (windows) to artifacts'
condition: eq(variables.rid, 'windows-x64')
inputs:
targetPath: './Photino.Native/x64/$(buildConfiguration)/WebView2Loader.dll'
artifactName: 'WebView2Loader.dll'
- task: PublishPipelineArtifact@1
displayName: 'Publish Photino.Native.nuspec (windows) to artifacts'
condition: eq(variables.rid, 'windows-x64')
inputs:
targetPath: './Photino.Native/Photino.Native.nuspec'
artifactName: 'Photino.Native.nuspec'
- task: PublishPipelineArtifact@1
displayName: 'Publish Photino.Native.so (linux) to artifacts'
condition: eq(variables.rid, 'linux-x64')
inputs:
targetPath: './Photino.Native/x64/$(buildConfiguration)/Photino.Native.so'
artifactName: 'Photino.Native.so'
- task: PublishPipelineArtifact@1
displayName: 'Publish Photino.Native.dylib (macOS) to artifacts'
condition: eq(variables.rid, 'osx-x64')
inputs:
targetPath: './x64/$(buildConfiguration)/Photino.Native.dylib'
artifactName: 'Photino.Native.dylib'
#1 instance to download all native files, create NuGet package and publish to Artifacts
- job: 'PublishPackage'
dependsOn: 'BuildNative'
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
steps:
#Download native files from Artifacts
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'Photino.Native.dll'
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'WebView2Loader.dll'
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'Photino.Native.nuspec'
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'Photino.Native.so'
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'Photino.Native.dylib'
#- task: CmdLine@2
# displayName: 'List downloaded files'
## inputs:
# workingDirectory: '$(Pipeline.Workspace)'
# script: 'dir'
#Create NuGet package
- task: CmdLine@2
displayName: 'Create NuGet package'
inputs:
workingDirectory: '$(Pipeline.Workspace)'
script: 'nuget.exe pack Photino.Native.nuspec -Version $(versionprefix)-$(Build.BuildNumber) -NonInteractive -Properties version=$(versionprefix)-$(Build.BuildNumber)'
#Publish NuGet package to Artifacts
- task: NuGetAuthenticate@0
displayName: 'NuGet Authenticate'
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
feedsToUse: 'select'
publishVstsFeed: 'Photino.Native/PhotinoPackages'
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg'
allowPackageConflicts: true