azure-pipelines.asyncrx.yml 3.6 KB

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