azure-pipelines.ix.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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: ubuntu-latest
  30. steps:
  31. - task: UseDotNet@2
  32. displayName: Use .NET Core 5.0.x SDK
  33. inputs:
  34. version: 5.0.x
  35. includePreviewVersions: true
  36. - task: UseDotNet@2
  37. displayName: .NET Core 3.1 runtime
  38. inputs:
  39. version: '3.1.x'
  40. packageType: runtime
  41. - task: UseDotNet@2
  42. displayName: .NET Core 2.1 runtime
  43. inputs:
  44. version: '2.1.x'
  45. packageType: runtime
  46. - task: DotNetCoreCLI@2
  47. inputs:
  48. command: custom
  49. custom: tool
  50. arguments: install --tool-path . nbgv
  51. displayName: Install NBGV tool
  52. - script: nbgv cloud -p Ix.NET/Source
  53. displayName: Set Version
  54. - task: DotNetCoreCLI@2
  55. inputs:
  56. command: restore
  57. projects: Ix.NET/Source/**/*.csproj
  58. displayName: Restore
  59. - task: DotNetCoreCLI@2
  60. inputs:
  61. command: pack
  62. packagesToPack: Ix.NET/Source/**/System.Interactive*.csproj;Ix.NET/Source/**/System.Linq.*.csproj;!Ix.NET/Source/**/*.Tests*.csproj;!Ix.NET/Source/refs/**
  63. configuration: $(BuildConfiguration)
  64. packDirectory: $(Build.ArtifactStagingDirectory)/artifacts
  65. verbosityPack: Minimal
  66. displayName: Pack
  67. - task: DotNetCoreCLI@2
  68. inputs:
  69. command: custom
  70. custom: tool
  71. arguments: install --tool-path . dotnet-reportgenerator-globaltool
  72. displayName: Install ReportGenerator tool
  73. - task: DotNetCoreCLI@2
  74. inputs:
  75. command: test
  76. projects: Ix.NET/Source/**/*.Tests.csproj
  77. arguments: -c $(BuildConfiguration) --settings Ix.NET/Source/CodeCoverage.runsettings --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true
  78. displayName: Run Tests
  79. - script: reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/Ix.NET/Source/coverlet/reports -reporttypes:"Cobertura"
  80. displayName: Create reports
  81. - task: PublishCodeCoverageResults@1
  82. displayName: 'Publish code coverage'
  83. inputs:
  84. codeCoverageTool: Cobertura
  85. summaryFileLocation: $(Build.SourcesDirectory)/Ix.NET/Source/coverlet/reports/Cobertura.xml
  86. - publish: Ix.NET/Source/build
  87. artifact: config
  88. displayName: Publish signing config
  89. - publish: $(Build.ArtifactStagingDirectory)/artifacts
  90. displayName: Publish artifacts
  91. artifact: BuildPackages
  92. - stage: CodeSign
  93. condition: and(succeeded('Build'), not(eq(variables['build.reason'], 'PullRequest')))
  94. jobs:
  95. - deployment: CodeSign
  96. displayName: Code Signing
  97. pool:
  98. vmImage: windows-latest
  99. environment: Code Sign
  100. variables:
  101. - group: SignClient Credentials
  102. strategy:
  103. runOnce:
  104. deploy:
  105. steps:
  106. - task: DotNetCoreCLI@2
  107. inputs:
  108. command: custom
  109. custom: tool
  110. arguments: install --tool-path . SignClient
  111. displayName: Install SignTool tool
  112. - pwsh: |
  113. .\SignClient "Sign" `
  114. --baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
  115. --input "**/*.nupkg" `
  116. --config "$(Pipeline.Workspace)\config\signclient.json" `
  117. --user "$(SignClientUser)" `
  118. --secret "$(SignClientSecret)" `
  119. --name "Ix.NET" `
  120. --description "Ix.NET" `
  121. --descriptionUrl "https://github.com/dotnet/reactive"
  122. displayName: Sign packages
  123. - publish: $(Pipeline.Workspace)/BuildPackages
  124. displayName: Publish Signed Packages
  125. artifact: SignedPackages