azure-pipelines.asyncrx.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. pr:
  12. branches:
  13. include:
  14. - main
  15. - rel/*
  16. paths:
  17. include:
  18. - AsyncRx.NET/*
  19. - .editorconfig
  20. - azure-pipelines.asyncrx.yml
  21. stages:
  22. - stage: Build
  23. jobs:
  24. - job: Build
  25. pool:
  26. vmImage: windows-latest
  27. variables:
  28. BuildConfiguration: Release
  29. BuildPlatform: Any CPU
  30. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  31. steps:
  32. - task: UseDotNet@2
  33. displayName: Use .NET Core 7.0.x SDK
  34. inputs:
  35. version: 7.0.x
  36. performMultiLevelLookup: true
  37. - task: DotNetCoreCLI@2
  38. inputs:
  39. command: custom
  40. custom: tool
  41. arguments: install --tool-path . nbgv
  42. displayName: Install NBGV tool
  43. - script: nbgv cloud -a -p AsyncRx.NET
  44. displayName: Set Version
  45. - task: MSBuild@1
  46. displayName: Build AsyncRx.NET.sln
  47. inputs:
  48. solution: AsyncRx.NET/AsyncRx.NET.sln
  49. msbuildArguments: /restore /t:build /p:CreatePackage=true /p:NoPackageAnalysis=true /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\artifacts
  50. configuration: $(BuildConfiguration)
  51. maximumCpuCount: false
  52. - task: DotNetCoreCLI@2
  53. inputs:
  54. command: custom
  55. custom: tool
  56. arguments: install --tool-path . dotnet-reportgenerator-globaltool
  57. displayName: Install ReportGenerator tool
  58. # Normally we'd run tests here, but AsyncRx.NET doesn't have any yet!
  59. # Once we're ready to stablize, we'd also add API surface area tests too
  60. - publish: AsyncRx.NET/build
  61. artifact: config
  62. displayName: Publish signing config
  63. - publish: $(Build.ArtifactStagingDirectory)\artifacts
  64. displayName: Publish artifacts
  65. artifact: BuildPackages
  66. # Rx.NET has an IntegrationTests stage. Consider this once we have tests
  67. - stage: CodeSign
  68. # In Rx, the condition includes:
  69. # succeeded('IntegrationTests')
  70. condition: not(eq(variables['build.reason'], 'PullRequest'))
  71. jobs:
  72. - deployment: CodeSign
  73. displayName: Code Signing
  74. pool:
  75. vmImage: windows-latest
  76. environment: Code Sign
  77. variables:
  78. - group: SignClient Credentials
  79. strategy:
  80. runOnce:
  81. deploy:
  82. steps:
  83. - task: UseDotNet@2
  84. displayName: Use .NET 8.0.x SDK
  85. inputs:
  86. version: 8.0.x
  87. performMultiLevelLookup: true
  88. - task: DotNetCoreCLI@2
  89. displayName: Install SignTool tool
  90. inputs:
  91. command: custom
  92. custom: tool
  93. arguments: install --tool-path . sign --version 0.9.1-beta.24406.1
  94. - task: AzureCLI@2
  95. inputs:
  96. azureSubscription: 'Rx.NET Sign Service Connection'
  97. scriptType: pscore
  98. scriptLocation: inlineScript
  99. inlineScript: |
  100. .\sign code azure-key-vault `
  101. "**/*.nupkg" `
  102. --base-directory "$(Pipeline.Workspace)\BuildPackages" `
  103. --publisher-name "Reactive Extensions for .NET (.NET Foundation)" `
  104. --description "AsyncRx.NET" `
  105. --description-url "https://github.com/dotnet/reactive" `
  106. --azure-key-vault-url "$(SignKeyVaultUrl)" `
  107. --azure-key-vault-certificate "$(SignKeyVaultCertificateName)"
  108. displayName: Sign packages
  109. - publish: $(Pipeline.Workspace)/BuildPackages
  110. displayName: Publish Signed Packages
  111. artifact: SignedPackages