浏览代码

Merge pull request #4249 from jellyfin/EraYaN-openapi-spec-fix

Publish OpenAPI spec for master and tagged releases
Joshua M. Boniface 4 年之前
父节点
当前提交
5f65fd93a1
共有 2 个文件被更改,包括 38 次插入1 次删除
  1. 32 1
      .ci/azure-pipelines-package.yml
  2. 6 0
      .ci/azure-pipelines.yml

+ 32 - 1
.ci/azure-pipelines-package.yml

@@ -63,7 +63,38 @@ jobs:
       sshEndpoint: repository
       sourceFolder: '$(Build.SourcesDirectory)/deployment/dist'
       contents: '**'
-      targetFolder: '/srv/repository/incoming/azure/$(Build.BuildNumber)/$(BuildConfiguration)'
+
+- job: OpenAPISpec
+  dependsOn: Test
+  condition: or(startsWith(variables['Build.SourceBranch'], 'refs/heads/master'),startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
+  displayName: 'Push OpenAPI Spec to repository'
+
+  pool:
+    vmImage: 'ubuntu-latest'
+
+  steps:
+  - task: DownloadPipelineArtifact@2
+    displayName: 'Download OpenAPI Spec'
+    inputs:
+      source: 'current'
+      artifact: "OpenAPI Spec"
+      path: "$(System.ArtifactsDirectory)/openapispec"
+      runVersion: "latest"
+
+  - task: SSH@0
+    displayName: 'Create target directory on repository server'
+    inputs:
+      sshEndpoint: repository
+      runOptions: 'inline'
+      inline: 'mkdir -p /srv/repository/incoming/azure/$(Build.BuildNumber)'
+
+  - task: CopyFilesOverSSH@0
+    displayName: 'Upload artifacts to repository server'
+    inputs:
+      sshEndpoint: repository
+      sourceFolder: '$(System.ArtifactsDirectory)/openapispec'
+      contents: 'openapi.json'
+      targetFolder: '/srv/repository/incoming/azure/$(Build.BuildNumber)'
 
 - job: BuildDocker
   displayName: 'Build Docker'

+ 6 - 0
.ci/azure-pipelines.yml

@@ -34,6 +34,12 @@ jobs:
         Linux: 'ubuntu-latest'
         Windows: 'windows-latest'
         macOS: 'macos-latest'
+        
+- ${{ if or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master')) }}:
+  - template: azure-pipelines-test.yml
+    parameters:
+      ImageNames:
+        Linux: 'ubuntu-latest'
 
 - ${{ if not(or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master'))) }}:
   - template: azure-pipelines-abi.yml