1
0

azure-pipelines.ix.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. trigger:
  2. branches:
  3. include:
  4. - main
  5. - rel/*
  6. paths:
  7. include:
  8. - Ix.NET/Source/*
  9. - .editorconfig
  10. - azure-pipelines.ix.yml
  11. pr:
  12. branches:
  13. include:
  14. - main
  15. - rel/*
  16. paths:
  17. include:
  18. - Ix.NET/Source/*
  19. - .editorconfig
  20. - azure-pipelines.ix.yml
  21. variables:
  22. BuildConfiguration: Release
  23. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  24. stages:
  25. - stage: Build
  26. jobs:
  27. - job: Build
  28. pool:
  29. vmImage: windows-latest
  30. steps:
  31. - task: UseDotNet@2
  32. displayName: Use .NET Core 10.x SDK
  33. inputs:
  34. version: 10.x
  35. includePreviewVersions: true
  36. - task: UseDotNet@2
  37. displayName: .NET 8.0 runtime
  38. inputs:
  39. version: '8.x'
  40. packageType: runtime
  41. - task: DotNetCoreCLI@2
  42. inputs:
  43. command: custom
  44. custom: tool
  45. arguments: install --tool-path . nbgv
  46. displayName: Install NBGV tool
  47. - script: nbgv cloud -a -p Ix.NET/Source
  48. displayName: Set Version
  49. - task: DotNetCoreCLI@2
  50. inputs:
  51. command: restore
  52. projects: Ix.NET/Source/**/*.csproj
  53. displayName: Restore
  54. # Since we can no longer use MSBuild.Extras.SDK, the reference assembly projects don't get built automatically
  55. # when the corresponding main project run, so we need this extra build step to ensure that the files exist by
  56. # the time pack runs
  57. - task: DotNetCoreCLI@2
  58. inputs:
  59. command: build
  60. arguments: -c $(BuildConfiguration)
  61. projects: Ix.NET/Source/refs/**/*.csproj
  62. displayName: Build reference assemblies
  63. - task: DotNetCoreCLI@2
  64. inputs:
  65. command: pack
  66. packagesToPack: Ix.NET/Source/**/System.Interactive*.csproj;Ix.NET/Source/**/System.Linq.*.csproj;!Ix.NET/Source/**/*.Tests*.csproj;!Ix.NET/Source/refs/**
  67. configuration: $(BuildConfiguration)
  68. packDirectory: $(Build.ArtifactStagingDirectory)/artifacts
  69. verbosityPack: Minimal
  70. displayName: Pack
  71. - task: DotNetCoreCLI@2
  72. inputs:
  73. command: custom
  74. custom: tool
  75. arguments: install --tool-path . dotnet-reportgenerator-globaltool
  76. displayName: Install ReportGenerator tool
  77. - task: DotNetCoreCLI@2
  78. inputs:
  79. command: test
  80. projects: Ix.NET/Source/**/*.Tests.csproj
  81. arguments: -c $(BuildConfiguration) --settings Ix.NET/Source/CodeCoverage.runsettings --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true
  82. displayName: Run Tests
  83. - script: reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/Ix.NET/Source/coverlet/reports -reporttypes:"Cobertura"
  84. displayName: Create reports
  85. - task: PublishCodeCoverageResults@1
  86. displayName: 'Publish code coverage'
  87. inputs:
  88. codeCoverageTool: Cobertura
  89. summaryFileLocation: $(Build.SourcesDirectory)/Ix.NET/Source/coverlet/reports/Cobertura.xml
  90. - publish: Ix.NET/Source/build
  91. artifact: config
  92. displayName: Publish signing config
  93. - publish: $(Build.ArtifactStagingDirectory)/artifacts
  94. displayName: Publish artifacts
  95. artifact: BuildPackages
  96. - stage: CodeSign
  97. condition: and(succeeded('Build'), not(eq(variables['build.reason'], 'PullRequest')))
  98. jobs:
  99. - deployment: CodeSign
  100. displayName: Code Signing
  101. pool:
  102. vmImage: windows-latest
  103. environment: Code Sign
  104. variables:
  105. - group: SignClient Credentials
  106. strategy:
  107. runOnce:
  108. deploy:
  109. steps:
  110. - task: UseDotNet@2
  111. displayName: Use .NET 8.0.x SDK
  112. inputs:
  113. version: 8.0.x
  114. performMultiLevelLookup: true
  115. - task: DotNetCoreCLI@2
  116. displayName: Install SignTool tool
  117. inputs:
  118. command: custom
  119. custom: tool
  120. arguments: install --tool-path . sign --version 0.9.1-beta.24406.1
  121. - task: AzureCLI@2
  122. inputs:
  123. azureSubscription: 'Rx.NET Sign Service Connection'
  124. scriptType: pscore
  125. scriptLocation: inlineScript
  126. inlineScript: |
  127. .\sign code azure-key-vault `
  128. "**/*.nupkg" `
  129. --base-directory "$(Pipeline.Workspace)\BuildPackages" `
  130. --publisher-name "Reactive Extensions for .NET (.NET Foundation)" `
  131. --description "Ix.NET" `
  132. --description-url "https://github.com/dotnet/reactive" `
  133. --azure-key-vault-url "$(SignKeyVaultUrl)" `
  134. --azure-key-vault-certificate "$(SignKeyVaultCertificateName)"
  135. displayName: Sign packages
  136. - publish: $(Pipeline.Workspace)/BuildPackages
  137. displayName: Publish Signed Packages
  138. artifact: SignedPackages