Explorar o código

Fix path typo and add same code to main build.

Erwin de Haan %!s(int64=5) %!d(string=hai) anos
pai
achega
e9fb46b0cd
Modificáronse 1 ficheiros con 28 adicións e 7 borrados
  1. 28 7
      .ci/azure-pipelines.yml

+ 28 - 7
.ci/azure-pipelines.yml

@@ -31,18 +31,39 @@ jobs:
       persistCredentials: true
 
     - task: CmdLine@2
-      displayName: "Update submodules"
+      displayName: "Check out web"
       condition: and(succeeded(), or(contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
       inputs:
-        script: 'git submodule foreach --recursive git checkout $(Build.SourceBranch)'
-        workingDirectory: '$(Build.SourcesDirectory)'
+        script: 'git clone --single-branch --branch $(Build.SourceBranch) --depth=1 https://github.com/jellyfin/jellyfin-web.git $(Agent.TempDirectory)/jellyfin-web'
 
     - task: CmdLine@2
-      displayName: "Update submodules (PR)"
+      displayName: "Check out web (PR)"
       condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest'))
       inputs:
-        script: 'git submodule foreach --recursive git checkout $(System.PullRequest.TargetBranch)'
-        workingDirectory: '$(Build.SourcesDirectory)'
+        script: 'git clone --single-branch --branch $(System.PullRequest.TargetBranch) --depth 1 https://github.com/jellyfin/jellyfin-web.git $(Agent.TempDirectory)/jellyfin-web'
+
+    - task: NodeTool@0
+      displayName: 'Install Node.js'
+      condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master'), contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest', 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
+      inputs:
+        versionSpec: '10.x'
+
+    - task: CmdLine@2
+      displayName: "Build Web UI"
+      condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master'), contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest', 'IndividualCI', 'BatchedCI', 'BuildCompletion'))
+      inputs:
+        script: yarn install
+        workingDirectory: $(Agent.TempDirectory)/jellyfin-web
+
+    - task: CopyFiles@2
+      displayName: Copy the web UI
+      inputs:
+        sourceFolder: $(Agent.TempDirectory)/jellyfin-web/dist # Optional
+        contents: '**'
+        targetFolder: $(Build.SourcesDirectory)/MediaBrowser.WebDashboard/jellyfin-web
+        cleanTargetFolder: true # Optional
+        overWrite: true # Optional
+        flattenFolders: false # Optional
 
     - task: DotNetCoreCLI@2
       displayName: Publish
@@ -235,7 +256,7 @@ jobs:
       inputs:
         sourceFolder: $(Build.SourcesDirectory)/deployment/windows/ # Optional
         contents: 'jellyfin*.exe'
-        targetFolder: $(System.ArtifactsDirectory)/MediaBrowser.WebDashboard/jellyfin-web
+        targetFolder: $(System.ArtifactsDirectory)/setup
         cleanTargetFolder: true # Optional
         overWrite: true # Optional
         flattenFolders: true # Optional