Skip to content

Commit 47d0f79

Browse files
authored
Add AsyncRx.NET build pipeline (#1888)
1 parent 88001b1 commit 47d0f79

File tree

6 files changed

+149
-1
lines changed

6 files changed

+149
-1
lines changed

AsyncRx.NET/ApiCompare/ApiCompare.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
7+
<!-- You wouldn't think we'd need this with an Exe, but it seems this is getting published as a package without this! -->
8+
<IsPackable>false</IsPackable>
9+
<TargetFramework>net6.0</TargetFramework>
610
</PropertyGroup>
711

812
<ItemGroup>

AsyncRx.NET/Directory.build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<DefaultLanguage>en-US</DefaultLanguage>
1515
<IncludeSymbols>false</IncludeSymbols>
1616
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
17-
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Rx.ruleset</CodeAnalysisRuleSet>
1817
<GeneratePackageOnBuild Condition=" '$(IsTestProject)' != 'true' and '$(CreatePackage)' == 'true' ">true</GeneratePackageOnBuild>
1918
<PackageOutputPath>$(MSBuildThisFileDirectory)artifacts</PackageOutputPath>
2019
<EmbedUntrackedSources>true</EmbedUntrackedSources>

AsyncRx.NET/Playground/Playground.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
7+
<!-- You wouldn't think we'd need this with an Exe, but it seems this is getting published as a package without this! -->
8+
<IsPackable>false</IsPackable>
9+
<TargetFramework>net6.0</TargetFramework>
610
</PropertyGroup>
711

812
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

AsyncRx.NET/build/signclient.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"SignClient": {
3+
"AzureAd": {
4+
"AADInstance": "https://login.microsoftonline.com/",
5+
"ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8",
6+
"TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e"
7+
},
8+
"Service": {
9+
"Url": "https://codesign.dotnetfoundation.org/",
10+
"ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001"
11+
}
12+
}
13+
}

AsyncRx.NET/version.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "6.0.0-alpha.{height}",
3+
"publicReleaseRefSpec": [
4+
"^refs/heads/main$", // we release out of main
5+
"^refs/heads/rel/v\\d+\\.\\d+", // we also release branches starting with rel/vN.N
6+
"^refs/heads/rel/rx-v\\d+\\.\\d+" // we also release branches starting with rel/vN.N
7+
],
8+
"nugetPackageVersion":{
9+
"semVer": 2
10+
}
11+
}

azure-pipelines.asyncrx.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
trigger:
2+
branches:
3+
include:
4+
- main
5+
- rel/*
6+
paths:
7+
include:
8+
- AsyncRx.NET/*
9+
- .editorconfig
10+
- azure-pipelines.asyncrx.yml
11+
12+
pr:
13+
branches:
14+
include:
15+
- main
16+
- rel/*
17+
paths:
18+
include:
19+
- AsyncRx.NET/*
20+
- .editorconfig
21+
- azure-pipelines.asyncrx.yml
22+
23+
stages:
24+
- stage: Build
25+
jobs:
26+
- job: Build
27+
pool:
28+
vmImage: windows-latest
29+
30+
variables:
31+
BuildConfiguration: Release
32+
BuildPlatform: Any CPU
33+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
34+
35+
steps:
36+
- task: UseDotNet@2
37+
displayName: Use .NET Core 7.0.x SDK
38+
inputs:
39+
version: 7.0.x
40+
performMultiLevelLookup: true
41+
42+
- task: DotNetCoreCLI@2
43+
inputs:
44+
command: custom
45+
custom: tool
46+
arguments: install --tool-path . nbgv
47+
displayName: Install NBGV tool
48+
49+
- script: nbgv cloud -a -p AsyncRx.NET
50+
displayName: Set Version
51+
52+
- task: MSBuild@1
53+
displayName: Build AsyncRx.NET.sln
54+
inputs:
55+
solution: AsyncRx.NET/AsyncRx.NET.sln
56+
msbuildArguments: /restore /t:build /p:CreatePackage=true /p:NoPackageAnalysis=true /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\artifacts
57+
configuration: $(BuildConfiguration)
58+
maximumCpuCount: false
59+
60+
- task: DotNetCoreCLI@2
61+
inputs:
62+
command: custom
63+
custom: tool
64+
arguments: install --tool-path . dotnet-reportgenerator-globaltool
65+
displayName: Install ReportGenerator tool
66+
67+
# Normally we'd run tests here, but AsyncRx.NET doesn't have any yet!
68+
# Once we're ready to stablize, we'd also add API surface area tests too
69+
70+
- publish: AsyncRx.NET/build
71+
artifact: config
72+
displayName: Publish signing config
73+
74+
- publish: $(Build.ArtifactStagingDirectory)\artifacts
75+
displayName: Publish artifacts
76+
artifact: BuildPackages
77+
78+
# Rx.NET has an IntegrationTests stage. Consider this once we have tests
79+
80+
- stage: CodeSign
81+
# In Rx, the condition includes:
82+
# succeeded('IntegrationTests')
83+
condition: not(eq(variables['build.reason'], 'PullRequest'))
84+
jobs:
85+
- deployment: CodeSign
86+
displayName: Code Signing
87+
pool:
88+
vmImage: windows-latest
89+
environment: Code Sign
90+
variables:
91+
- group: SignClient Credentials
92+
strategy:
93+
runOnce:
94+
deploy:
95+
steps:
96+
- task: DotNetCoreCLI@2
97+
inputs:
98+
command: custom
99+
custom: tool
100+
arguments: install --tool-path . SignClient
101+
displayName: Install SignTool tool
102+
103+
- pwsh: |
104+
.\SignClient "Sign" `
105+
--baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
106+
--input "**/*.nupkg" `
107+
--config "$(Pipeline.Workspace)\config\signclient.json" `
108+
--user "$(SignClientUser)" `
109+
--secret "$(SignClientSecret)" `
110+
--name "Rx.NET" `
111+
--description "Rx.NET" `
112+
--descriptionUrl "https://github.com/dotnet/reactive"
113+
displayName: Sign packages
114+
115+
- publish: $(Pipeline.Workspace)/BuildPackages
116+
displayName: Publish Signed Packages
117+
artifact: SignedPackages

0 commit comments

Comments
 (0)