123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- trigger:
- branches:
- include:
- - main
- - rel/*
- paths:
- include:
- - Ix.NET/Source/*
- - .editorconfig
- - azure-pipelines.ix.yml
- pr:
- branches:
- include:
- - main
- - rel/*
- paths:
- include:
- - Ix.NET/Source/*
- - .editorconfig
- - azure-pipelines.ix.yml
- variables:
- BuildConfiguration: Release
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- stages:
- - stage: Build
- jobs:
- - job: Build
- pool:
- vmImage: windows-latest
- steps:
- - task: UseDotNet@2
- displayName: Use .NET Core 10.x SDK
- inputs:
- version: 10.x
- includePreviewVersions: true
- - task: UseDotNet@2
- displayName: .NET 8.0 runtime
- inputs:
- version: '8.x'
- packageType: runtime
- - task: DotNetCoreCLI@2
- inputs:
- command: custom
- custom: tool
- arguments: install --tool-path . nbgv
- displayName: Install NBGV tool
- - script: nbgv cloud -a -p Ix.NET/Source
- displayName: Set Version
- - task: DotNetCoreCLI@2
- inputs:
- command: restore
- projects: Ix.NET/Source/**/*.csproj
- displayName: Restore
- # Since we can no longer use MSBuild.Extras.SDK, the reference assembly projects don't get built automatically
- # when the corresponding main project run, so we need this extra build step to ensure that the files exist by
- # the time pack runs
- - task: DotNetCoreCLI@2
- inputs:
- command: build
- arguments: -c $(BuildConfiguration)
- projects: Ix.NET/Source/refs/**/*.csproj
- displayName: Build reference assemblies
- - task: DotNetCoreCLI@2
- inputs:
- command: pack
- packagesToPack: Ix.NET/Source/**/System.Interactive*.csproj;Ix.NET/Source/**/System.Linq.*.csproj;!Ix.NET/Source/**/*.Tests*.csproj;!Ix.NET/Source/refs/**
- configuration: $(BuildConfiguration)
- packDirectory: $(Build.ArtifactStagingDirectory)/artifacts
- verbosityPack: Minimal
- displayName: Pack
- - task: DotNetCoreCLI@2
- inputs:
- command: custom
- custom: tool
- arguments: install --tool-path . dotnet-reportgenerator-globaltool
- displayName: Install ReportGenerator tool
- - task: DotNetCoreCLI@2
- inputs:
- command: test
- projects: Ix.NET/Source/**/*.Tests.csproj
- arguments: -c $(BuildConfiguration) --settings Ix.NET/Source/CodeCoverage.runsettings --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true
- displayName: Run Tests
- - script: reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/Ix.NET/Source/coverlet/reports -reporttypes:"Cobertura"
- displayName: Create reports
- - task: PublishCodeCoverageResults@1
- displayName: 'Publish code coverage'
- inputs:
- codeCoverageTool: Cobertura
- summaryFileLocation: $(Build.SourcesDirectory)/Ix.NET/Source/coverlet/reports/Cobertura.xml
- - publish: Ix.NET/Source/build
- artifact: config
- displayName: Publish signing config
- - publish: $(Build.ArtifactStagingDirectory)/artifacts
- displayName: Publish artifacts
- artifact: BuildPackages
- - stage: CodeSign
- condition: and(succeeded('Build'), not(eq(variables['build.reason'], 'PullRequest')))
- jobs:
- - deployment: CodeSign
- displayName: Code Signing
- pool:
- vmImage: windows-latest
- environment: Code Sign
- variables:
- - group: SignClient Credentials
- strategy:
- runOnce:
- deploy:
- steps:
- - task: UseDotNet@2
- displayName: Use .NET 8.0.x SDK
- inputs:
- version: 8.0.x
- performMultiLevelLookup: true
- - task: DotNetCoreCLI@2
- displayName: Install SignTool tool
- inputs:
- command: custom
- custom: tool
- arguments: install --tool-path . sign --version 0.9.1-beta.24406.1
- - task: AzureCLI@2
- inputs:
- azureSubscription: 'Rx.NET Sign Service Connection'
- scriptType: pscore
- scriptLocation: inlineScript
- inlineScript: |
- .\sign code azure-key-vault `
- "**/*.nupkg" `
- --base-directory "$(Pipeline.Workspace)\BuildPackages" `
- --publisher-name "Reactive Extensions for .NET (.NET Foundation)" `
- --description "Ix.NET" `
- --description-url "https://github.com/dotnet/reactive" `
- --azure-key-vault-url "$(SignKeyVaultUrl)" `
- --azure-key-vault-certificate "$(SignKeyVaultCertificateName)"
- displayName: Sign packages
- - publish: $(Pipeline.Workspace)/BuildPackages
- displayName: Publish Signed Packages
- artifact: SignedPackages
|