/
azure-pipelines.yml
172 lines (162 loc) · 7.42 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
parameters:
- name: runtimeBranch
displayName: Branch for runtime repository
type: string
default: v5.0.14
- name: aspBranch
displayName: Branch for aspnetcore repository
type: string
default: v5.0.14
- name: sdkBranch
displayName: Branch for installer repository
type: string
default: v5.0.405
variables:
runCounter: $[counter('runNumber', 1)]
resources:
repositories:
- repository: runtime
type: github
endpoint: Servarr
name: dotnet/runtime
ref: release/5.0
- repository: aspnetcore
type: github
endpoint: Servarr
name: dotnet/aspnetcore
ref: release/5.0
- repository: installer
type: github
endpoint: Servarr
name: dotnet/installer
ref: release/5.0.4xx
trigger:
branches:
include:
- v5
pr:
- v5
stages:
- stage: Runtime
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 }}
sed -i '/\/dnceng\/internal\//d' runtime/NuGet.config
displayName: Checkout and patch
- bash: |
DOTNET_DOCKER_TAG=mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-freebsd-11-20210917001307-f13d79e
echo $DOTNET_DOCKER_TAG
docker run -e ROOTFS_DIR=/crossrootfs/x64 -v ${BUILD_SOURCESDIRECTORY}/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/build.sh -ci -c Release -cross -os freebsd /p:BuildNumberMajor=21102 /p:BuildNumberMinor=12 /p:OfficialBuildId=20210202.12 /p:IsEligibleForNgenOptimization=false
displayName: Build Runtime
- publish: '$(Build.SourcesDirectory)/runtime/artifacts/packages/Release/Shipping'
artifact: RuntimePackages
displayName: Publish Runtime
- 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 }}
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
dotnet nuget add source ../runtime/artifacts/packages/Release/Shipping --name local --configfile aspnetcore/NuGet.config
sed -i '/\/dnceng\/internal\//d' aspnetcore/NuGet.config
displayName: Apply patches
- 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
- bash: |
set -e
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/build.sh -c Release -ci --os-name freebsd -pack -nobl /p:CrossgenOutput=false /p:OfficialBuildId=$(date +%Y%m%d)-99
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
- stage: Installer
dependsOn: AspNetCore
pool:
vmImage: 'ubuntu-20.04'
jobs:
- job: Installer
timeoutInMinutes: 0
steps:
- checkout: self
- checkout: installer
- bash: |
set -e
git -C installer checkout ${{ parameters.sdkBranch }}
git -C installer apply ../dotnet-bsd/patches/installer/0001-freebsd-support.patch
sed -i 's/NetCore5AppHostRids Include="@(NetCore31RuntimePackRids)/NetCore5AppHostRids Include="@(NetCore31RuntimePackRids);freebsd-x64/' installer/src/redist/targets/GenerateBundledVersions.targets
sed -i 's/AspNetCore50RuntimePackRids Include="@(AspNetCore31RuntimePackRids)/AspNetCore50RuntimePackRids Include="@(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: Apply patches
- 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-*'
- bash: |
set -e
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/
installer/build.sh -c Release -ci -pack -nobl --runtime-id freebsd-x64 /p:OSName=freebsd /p:CrossgenOutput=false /p:OfficialBuildId=$(date +%Y%m%d)-99 /p:DISABLE_CROSSGEN=True /p:IncludeAspNetCoreRuntime=True
displayName: Build Installer
- publish: '$(Build.SourcesDirectory)/installer/artifacts/packages/Release/Shipping'
artifact: Installer
displayName: Publish Installer