2
0

azure-pipelines.yml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. jobs:
  12. - job: main_build
  13. displayName: Main Build
  14. pool:
  15. vmImage: ubuntu-16.04
  16. strategy:
  17. matrix:
  18. release:
  19. BuildConfiguration: Release
  20. debug:
  21. BuildConfiguration: Debug
  22. maxParallel: 2
  23. steps:
  24. - checkout: self
  25. clean: true
  26. submodules: true
  27. persistCredentials: false
  28. - task: DotNetCoreCLI@2
  29. displayName: Restore
  30. inputs:
  31. command: restore
  32. projects: '$(RestoreBuildProjects)'
  33. - task: DotNetCoreCLI@2
  34. displayName: Build
  35. inputs:
  36. projects: '$(RestoreBuildProjects)'
  37. arguments: '--configuration $(BuildConfiguration)'
  38. - task: DotNetCoreCLI@2
  39. displayName: Test
  40. inputs:
  41. command: test
  42. projects: '$(RestoreBuildProjects)'
  43. arguments: '--configuration $(BuildConfiguration)'
  44. enabled: false
  45. - task: DotNetCoreCLI@2
  46. displayName: Publish
  47. inputs:
  48. command: publish
  49. publishWebProjects: false
  50. projects: '$(RestoreBuildProjects)'
  51. arguments: '--configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)'
  52. zipAfterPublish: false
  53. # - task: PublishBuildArtifacts@1
  54. # displayName: 'Publish Artifact'
  55. # inputs:
  56. # PathtoPublish: '$(build.artifactstagingdirectory)'
  57. # artifactName: 'jellyfin-build-$(BuildConfiguration)'
  58. # zipAfterPublish: true
  59. - task: PublishBuildArtifacts@1
  60. displayName: 'Publish Artifact Naming'
  61. condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
  62. inputs:
  63. PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/Emby.Naming.dll'
  64. artifactName: 'Jellyfin.Naming'
  65. - task: PublishBuildArtifacts@1
  66. displayName: 'Publish Artifact Controller'
  67. condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
  68. inputs:
  69. PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Controller.dll'
  70. artifactName: 'Jellyfin.Controller'
  71. - task: PublishBuildArtifacts@1
  72. displayName: 'Publish Artifact Model'
  73. condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
  74. inputs:
  75. PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Model.dll'
  76. artifactName: 'Jellyfin.Model'
  77. - task: PublishBuildArtifacts@1
  78. displayName: 'Publish Artifact Common'
  79. condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
  80. inputs:
  81. PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Common.dll'
  82. artifactName: 'Jellyfin.Common'
  83. - job: dotnet_compat
  84. displayName: Compatibility Check
  85. pool:
  86. vmImage: ubuntu-16.04
  87. dependsOn: main_build
  88. condition: false #and(succeeded(), variables['System.PullRequest.PullRequestNumber']) # Only execute if the pullrequest numer is defined. (So not for normal CI builds)
  89. strategy:
  90. matrix:
  91. Naming:
  92. NugetPackageName: Jellyfin.Naming
  93. AssemblyFileName: Emby.Naming.dll
  94. Controller:
  95. NugetPackageName: Jellyfin.Controller
  96. AssemblyFileName: MediaBrowser.Controller.dll
  97. Model:
  98. NugetPackageName: Jellyfin.Model
  99. AssemblyFileName: MediaBrowser.Model.dll
  100. Common:
  101. NugetPackageName: Jellyfin.Common
  102. AssemblyFileName: MediaBrowser.Common.dll
  103. maxParallel: 2
  104. steps:
  105. - checkout: none
  106. - task: DownloadBuildArtifacts@0
  107. displayName: Download the Reference Assembly Build Artifact
  108. inputs:
  109. buildType: 'specific' # Options: current, specific
  110. project: $(System.TeamProjectId) # Required when buildType == Specific
  111. pipeline: $(System.DefinitionId) # Required when buildType == Specific, not sure if this will take a name too
  112. #specificBuildWithTriggering: false # Optional
  113. buildVersionToDownload: 'latestFromBranch' # Required when buildType == Specific# Options: latest, latestFromBranch, specific
  114. allowPartiallySucceededBuilds: false # Optional
  115. branchName: '$(System.PullRequest.TargetBranch)' # Required when buildType == Specific && BuildVersionToDownload == LatestFromBranch
  116. #buildId: # Required when buildType == Specific && BuildVersionToDownload == Specific
  117. #tags: # Optional
  118. downloadType: 'single' # Options: single, specific
  119. artifactName: '$(NugetPackageName)'# Required when downloadType == Single
  120. #itemPattern: '**' # Optional
  121. downloadPath: '$(System.ArtifactsDirectory)/current-artifacts'
  122. #parallelizationLimit: '8' # Optional
  123. - task: CopyFiles@2
  124. displayName: Copy Nuget Assembly to current-release folder
  125. inputs:
  126. sourceFolder: $(System.ArtifactsDirectory)/current-artifacts # Optional
  127. contents: '**/*.dll'
  128. targetFolder: $(System.ArtifactsDirectory)/current-release
  129. cleanTargetFolder: true # Optional
  130. overWrite: true # Optional
  131. flattenFolders: true # Optional
  132. - task: DownloadBuildArtifacts@0
  133. displayName: Download the New Assembly Build Artifact
  134. inputs:
  135. buildType: 'current' # Options: current, specific
  136. allowPartiallySucceededBuilds: false # Optional
  137. downloadType: 'single' # Options: single, specific
  138. artifactName: '$(NugetPackageName)' # Required when downloadType == Single
  139. downloadPath: '$(System.ArtifactsDirectory)/new-artifacts'
  140. - task: CopyFiles@2
  141. displayName: Copy Artifact Assembly to new-release folder
  142. inputs:
  143. sourceFolder: $(System.ArtifactsDirectory)/new-artifacts # Optional
  144. contents: '**/*.dll'
  145. targetFolder: $(System.ArtifactsDirectory)/new-release
  146. cleanTargetFolder: true # Optional
  147. overWrite: true # Optional
  148. flattenFolders: true # Optional
  149. - task: DownloadGitHubRelease@0
  150. displayName: Download ABI compatibility check tool from GitHub
  151. inputs:
  152. connection: Jellyfin GitHub
  153. userRepository: EraYaN/dotnet-compatibility
  154. defaultVersionType: 'latest' # Options: latest, specificVersion, specificTag
  155. #version: # Required when defaultVersionType != Latest
  156. itemPattern: '**-ci.zip' # Optional
  157. downloadPath: '$(System.ArtifactsDirectory)'
  158. - task: ExtractFiles@1
  159. displayName: Extract ABI compatibility check tool
  160. inputs:
  161. archiveFilePatterns: '$(System.ArtifactsDirectory)/*-ci.zip'
  162. destinationFolder: $(System.ArtifactsDirectory)/tools
  163. cleanDestinationFolder: true
  164. - task: CmdLine@2
  165. displayName: Execute ABI compatibility check tool
  166. inputs:
  167. script: 'dotnet tools/CompatibilityCheckerCoreCLI.dll current-release/$(AssemblyFileName) new-release/$(AssemblyFileName)'
  168. workingDirectory: $(System.ArtifactsDirectory) # Optional
  169. #failOnStderr: false # Optional