-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-pipelines.yml
254 lines (238 loc) · 10.9 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
parameters:
- name: runtimeBranch
displayName: Tag for runtime repository
type: string
default: v6.0.35
- name: aspBranch
displayName: Tag for aspnetcore repository
type: string
default: v6.0.35
- name: sdkBranch
displayName: Tag for sdk repository
type: string
default: v6.0.427
- name: installerBranch
displayName: Tag for installer repository
type: string
default: v6.0.427
variables:
runCounter: $[counter('runNumber', 1)]
resources:
repositories:
- repository: runtime
type: github
endpoint: Servarr
name: dotnet/runtime
ref: release/6.0
- repository: aspnetcore
type: github
endpoint: Servarr
name: dotnet/aspnetcore
ref: release/6.0
- repository: sdk
type: github
endpoint: Servarr
name: dotnet/sdk
ref: release/6.0.4xx
- repository: installer
type: github
endpoint: Servarr
name: dotnet/installer
ref: release/6.0.4xx
trigger:
branches:
include:
- v6
pr:
- v6
stages:
- stage: Runtime
dependsOn: []
pool:
vmImage: 'ubuntu-20.04'
jobs:
- job: Setup
steps:
- bash: |
BRANCH=${{ parameters.runtimeBranch }}
echo "##vso[build.updatebuildnumber]${BRANCH/\//-}-${RUNCOUNTER}"
displayName: Set Build Name
- job: Runtime
timeoutInMinutes: 0
steps:
- checkout: self
- checkout: runtime
- bash: |
set -e
git -C runtime checkout ${{ parameters.runtimeBranch }}
git -C runtime cherry-pick -n 3633a7d0930abaca701385c1059b80ca157e98c6
git -C runtime cherry-pick -n 3e6d492bdf6fbf2d8af3871379f31dcc6e27716b -Xours
sed -i '/\/dnceng\/internal\//d' runtime/NuGet.config
displayName: Checkout and patch
- bash: |
set -e
source dotnet-bsd/common.sh
DOTNET_DOCKER_TAG=mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-freebsd-11-20210917001307-f13d79e
echo $DOTNET_DOCKER_TAG
calculate_build_id $(git -C runtime tag --points-at HEAD)
echo $OFFICIALBUILDID
docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/eng/build.sh -ci -c Release -cross -os FreeBSD /p:IsEligibleForNgenOptimization=false /p:OfficialBuildId=$OFFICIALBUILDID -subset Clr.Native+Host.Native
docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/eng/build.sh -ci -c Release -cross -os FreeBSD /p:IsEligibleForNgenOptimization=false /p:OfficialBuildId=$OFFICIALBUILDID /p:AppHostSourcePath=/runtime/artifacts/obj/freebsd-x64.Release/apphost/standalone/apphost
displayName: Build Runtime
- publish: '$(Build.SourcesDirectory)/runtime/artifacts/packages/Release/Shipping'
artifact: RuntimePackages
displayName: Publish Runtime
- publish: '$(Build.SourcesDirectory)/runtime/artifacts/log'
condition: succeededOrFailed()
artifact: RuntimeLogs
displayName: Publish Build Logs
- stage: Sdk
dependsOn: []
pool:
vmImage: 'ubuntu-20.04'
jobs:
- job: Sdk
timeoutInMinutes: 0
steps:
- checkout: self
- checkout: sdk
- bash: |
set -e
git -C sdk checkout ${{ parameters.sdkBranch }}
displayName: Checkout and patch
- bash: |
source dotnet-bsd/common.sh
calculate_build_id $(git -C sdk tag --points-at HEAD)
echo $OFFICIALBUILDID
sdk/build.sh -c Release -pack -ci /p:OfficialBuildId=$OFFICIALBUILDID
displayName: Build SDK
- publish: '$(Build.SourcesDirectory)/sdk/artifacts/packages/Release/NonShipping/'
artifact: SdkPackages
displayName: Publish SDK
- publish: '$(Build.SourcesDirectory)/sdk/artifacts/log'
condition: succeededOrFailed()
artifact: SdkLogs
displayName: Publish Build Logs
- stage: AspNetCore
dependsOn: Runtime
pool:
vmImage: 'ubuntu-20.04'
jobs:
- job: AspNetCore
timeoutInMinutes: 0
steps:
- checkout: self
- checkout: aspnetcore
submodules: true
- bash: |
set -e
git -C aspnetcore checkout ${{ parameters.aspBranch }}
git -C aspnetcore submodule update --init
sed -i '/linux-x64;/a \ \ \ \ \ \ freebsd-x64;' aspnetcore/Directory.Build.props
sed -i '/<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.linux-x64" \/>/a \ \ \ \ <LatestPackageReference Include="Microsoft.NETCore.App.Runtime.freebsd-x64" \/>' aspnetcore/eng/Dependencies.props
sed -i 's/<Reference Include="Microsoft.NETCore.App.Crossgen2/<Reference Condition="'\''$(CrossgenOutput)'\'' == '\''true'\''" Include="Microsoft.NETCore.App.Crossgen2/' aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj
dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping --name local --configfile aspnetcore/NuGet.config
sed -i '/\/dnceng\/internal\//d' aspnetcore/NuGet.config
displayName: Checkout and patch
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: RuntimePackages
targetPath: '$(Build.SourcesDirectory)/runtime/artifacts/packages/Release/Shipping'
patterns: |
dotnet-runtime-*-freebsd-x64.tar.gz
Microsoft.*.freebsd-x64.*.nupkg
- task: NodeTool@0
inputs:
versionSource: 'spec'
versionSpec: '16.x'
- bash: |
source dotnet-bsd/common.sh
calculate_build_id $(git -C aspnetcore tag --points-at HEAD)
echo $OFFICIALBUILDID
ls -lR runtime
mkdir -p aspnetcore/artifacts/obj/Microsoft.AspNetCore.App.Runtime
cp runtime/artifacts/packages/Release/Shipping/dotnet-runtime-*-freebsd-x64.tar.gz aspnetcore/artifacts/obj/Microsoft.AspNetCore.App.Runtime
aspnetcore/eng/build.sh -c Release -ci --os-name freebsd -pack /p:CrossgenOutput=false /p:OfficialBuildId=$OFFICIALBUILDID
displayName: Build AspNetCore
- publish: '$(Build.SourcesDirectory)/aspnetcore/artifacts/packages/Release/Shipping'
artifact: AspNetCorePackages
displayName: Publish AspNetCore Packages
- publish: '$(Build.SourcesDirectory)/aspnetcore/artifacts/installers/Release'
artifact: AspNetCoreInstallers
displayName: Publish AspNetCore Installers
- publish: '$(Build.SourcesDirectory)/aspnetcore/artifacts/log'
condition: succeededOrFailed()
artifact: AspNetCoreLogs
displayName: Publish Build Logs
- stage: Installer
dependsOn:
- AspNetCore
- Sdk
pool:
vmImage: 'ubuntu-20.04'
jobs:
- job: Installer
timeoutInMinutes: 0
steps:
- checkout: self
- checkout: installer
- bash: |
set -e
git -C installer checkout ${{ parameters.installerBranch }}
git -C installer apply -C0 ../dotnet-bsd/patches/installer/0001-freebsd-support.patch
sed -i 's/@(NetCore31RuntimePackRids);/@(NetCore31RuntimePackRids);freebsd-x64;/' installer/src/redist/targets/GenerateBundledVersions.targets
sed -i 's/@(AspNetCore31RuntimePackRids);/@(AspNetCore31RuntimePackRids);freebsd-x64;/' installer/src/redist/targets/GenerateBundledVersions.targets
dotnet nuget remove source msbuild --configfile installer/NuGet.config || true
dotnet nuget remove source nuget-build --configfile installer/NuGet.config || true
dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping --name runtime --configfile installer/NuGet.config
dotnet nuget add source ../aspnetcore/artifacts/packages/Release/Shipping --name aspnetcore --configfile installer/NuGet.config
sed -i '/\/dnceng\/internal\//d' installer/NuGet.config
displayName: Checkout and patch
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: RuntimePackages
targetPath: '$(Build.SourcesDirectory)/runtime/artifacts/packages/Release/Shipping'
patterns: |
dotnet-runtime-*-freebsd-x64.tar.gz
Microsoft.*.freebsd-x64.*.nupkg
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: AspNetCorePackages
targetPath: '$(Build.SourcesDirectory)/aspnetcore/artifacts/packages/Release/Shipping'
patterns: |
Microsoft.*.freebsd-x64.*.nupkg
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: AspNetCoreInstallers
targetPath: '$(Build.SourcesDirectory)/aspnetcore/artifacts/installers/Release'
patterns: 'aspnetcore-runtime-*'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: SdkPackages
targetPath: '$(Build.SourcesDirectory)/sdk/artifacts/packages/Release/NonShipping/'
patterns: |
dotnet-toolset-internal-*.zip
- bash: |
source dotnet-bsd/common.sh
calculate_build_id $(git -C installer tag --points-at HEAD)
echo $OFFICIALBUILDID
ls -lR runtime
ls -lR aspnetcore
mkdir -p installer/artifacts/obj/redist/Release/downloads/
cp runtime/artifacts/packages/Release/Shipping/dotnet-runtime-*-freebsd-x64.tar.gz installer/artifacts/obj/redist/Release/downloads/
cp aspnetcore/artifacts/installers/Release/aspnetcore-runtime-* installer/artifacts/obj/redist/Release/downloads/
cp sdk/artifacts/packages/Release/NonShipping/dotnet-toolset-internal-*.zip installer/artifacts/obj/redist/Release/downloads/
installer/build.sh -c Release -ci -pack --runtime-id freebsd-x64 /p:OSName=freebsd /p:CrossgenOutput=false /p:DISABLE_CROSSGEN=True /p:IncludeAspNetCoreRuntime=True /p:OfficialBuildId=$OFFICIALBUILDID
displayName: Build Installer
- publish: '$(Build.SourcesDirectory)/installer/artifacts/packages/Release/Shipping'
artifact: Installer
displayName: Publish Installer
- publish: '$(Build.SourcesDirectory)/installer/artifacts/log'
condition: succeededOrFailed()
artifact: InstallerLogs
displayName: Publish Build Logs