azure-pipelines.yml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. name: $(Date:yyyyMMdd).$(Rev:.r)
  2. variables:
  3. - name: TestProjects
  4. value: 'Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj'
  5. - name: RestoreBuildProjects
  6. value: 'Jellyfin.Server/Jellyfin.Server.csproj'
  7. pr:
  8. autoCancel: true
  9. trigger:
  10. batch: true
  11. branches:
  12. include:
  13. - master
  14. jobs:
  15. - job: main_build
  16. displayName: Main Build
  17. pool:
  18. vmImage: ubuntu-16.04
  19. strategy:
  20. matrix:
  21. release:
  22. BuildConfiguration: Release
  23. debug:
  24. BuildConfiguration: Debug
  25. steps:
  26. - checkout: self
  27. clean: false
  28. submodules: true
  29. persistCredentials: false
  30. - task: DotNetCoreCLI@2
  31. displayName: Restore
  32. inputs:
  33. command: restore
  34. projects: '$(RestoreBuildProjects)'
  35. - task: DotNetCoreCLI@2
  36. displayName: Build
  37. inputs:
  38. projects: '$(RestoreBuildProjects)'
  39. arguments: '--configuration $(BuildConfiguration)'
  40. - task: DotNetCoreCLI@2
  41. displayName: Test
  42. inputs:
  43. command: test
  44. projects: '$(RestoreBuildProjects)'
  45. arguments: '--configuration $(BuildConfiguration)'
  46. enabled: false
  47. - task: DotNetCoreCLI@2
  48. displayName: Publish
  49. inputs:
  50. command: publish
  51. publishWebProjects: false
  52. projects: '$(RestoreBuildProjects)'
  53. arguments: '--configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)'
  54. zipAfterPublish: false
  55. # - task: PublishBuildArtifacts@1
  56. # displayName: 'Publish Artifact'
  57. # inputs:
  58. # PathtoPublish: '$(build.artifactstagingdirectory)'
  59. # artifactName: 'jellyfin-build-$(BuildConfiguration)'
  60. # zipAfterPublish: true
  61. - task: PublishBuildArtifacts@1
  62. displayName: 'Publish Artifact Naming'
  63. condition: eq(variables['BuildConfiguration'], 'Release')
  64. inputs:
  65. PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/Emby.Naming.dll'
  66. artifactName: 'Jellyfin.Naming'
  67. - task: PublishBuildArtifacts@1
  68. displayName: 'Publish Artifact Controller'
  69. condition: eq(variables['BuildConfiguration'], 'Release')
  70. inputs:
  71. PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Controller.dll'
  72. artifactName: 'Jellyfin.Controller'
  73. - task: PublishBuildArtifacts@1
  74. displayName: 'Publish Artifact Model'
  75. condition: eq(variables['BuildConfiguration'], 'Release')
  76. inputs:
  77. PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Model.dll'
  78. artifactName: 'Jellyfin.Model'
  79. - task: PublishBuildArtifacts@1
  80. displayName: 'Publish Artifact Common'
  81. condition: eq(variables['BuildConfiguration'], 'Release')
  82. inputs:
  83. PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Common.dll'
  84. artifactName: 'Jellyfin.Common'
  85. - job: dotnet_compat
  86. displayName: Compatibility Check
  87. pool:
  88. vmImage: ubuntu-16.04
  89. dependsOn: main_build
  90. condition: succeeded()
  91. strategy:
  92. matrix:
  93. Naming:
  94. NugetPackageName: Jellyfin.Naming
  95. AssemblyFileName: Emby.Naming.dll
  96. Controller:
  97. NugetPackageName: Jellyfin.Controller
  98. AssemblyFileName: MediaBrowser.Controller.dll
  99. Model:
  100. NugetPackageName: Jellyfin.Model
  101. AssemblyFileName: MediaBrowser.Model.dll
  102. Common:
  103. NugetPackageName: Jellyfin.Common
  104. AssemblyFileName: MediaBrowser.Common.dll
  105. steps:
  106. - checkout: none
  107. - task: NuGetCommand@2
  108. displayName: 'Download $(NugetPackageName)'
  109. inputs:
  110. command: custom
  111. arguments: 'install $(NugetPackageName) -OutputDirectory $(System.ArtifactsDirectory)/packages -ExcludeVersion -DirectDownload'
  112. - task: CopyFiles@2
  113. displayName: Copy Nuget Assembly to current-release folder
  114. inputs:
  115. sourceFolder: $(System.ArtifactsDirectory)/packages/$(NugetPackageName) # Optional
  116. contents: '**/*.dll'
  117. targetFolder: $(System.ArtifactsDirectory)/current-release
  118. cleanTargetFolder: true # Optional
  119. overWrite: true # Optional
  120. flattenFolders: true # Optional
  121. - task: DownloadBuildArtifacts@0
  122. displayName: Download the Assembly Build Artifact
  123. inputs:
  124. buildType: 'current' # Options: current, specific
  125. allowPartiallySucceededBuilds: false # Optional
  126. downloadType: 'single' # Options: single, specific
  127. artifactName: '$(NugetPackageName)' # Required when downloadType == Single
  128. downloadPath: '$(System.ArtifactsDirectory)/new-artifacts'
  129. - task: CopyFiles@2
  130. displayName: Copy Artifact Assembly to new-release folder
  131. inputs:
  132. sourceFolder: $(System.ArtifactsDirectory)/new-artifacts # Optional
  133. contents: '**/*.dll'
  134. targetFolder: $(System.ArtifactsDirectory)/new-release
  135. cleanTargetFolder: true # Optional
  136. overWrite: true # Optional
  137. flattenFolders: true # Optional
  138. - task: DownloadGitHubReleases@0
  139. displayName: Download ABI compatibility check tool from GitHub
  140. inputs:
  141. connection: GitHub (EraYaN)
  142. userRepository: EraYaN/dotnet-compatibility
  143. defaultVersionType: 'latest' # Options: latest, specificVersion, specificTag
  144. #version: # Required when defaultVersionType != Latest
  145. itemPattern: '**-ci.zip' # Optional
  146. downloadPath: '$(System.ArtifactsDirectory)'
  147. - task: ExtractFiles@1
  148. displayName: Extract ABI compatibility check tool
  149. inputs:
  150. archiveFilePatterns: '$(System.ArtifactsDirectory)/*-ci.zip'
  151. destinationFolder: $(System.ArtifactsDirectory)/tools
  152. cleanDestinationFolder: true
  153. - task: CmdLine@2
  154. displayName: Execute ABI compatibility check tool
  155. inputs:
  156. script: 'tools/CompatibilityCheckerCoreCLI current-release/$(AssemblyFileName) new-release/$(AssemblyFileName)'
  157. workingDirectory: $(System.ArtifactsDirectory) # Optional
  158. #failOnStderr: false # Optional