2019-09-19 11:35:30 -07:00
|
|
|
trigger:
|
|
|
|
batch: true
|
|
|
|
branches:
|
|
|
|
include:
|
2020-04-03 08:09:47 -07:00
|
|
|
- '*'
|
2019-09-19 11:35:30 -07:00
|
|
|
tags:
|
|
|
|
include:
|
|
|
|
- '*'
|
2020-03-15 13:53:28 -07:00
|
|
|
pr:
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- '*'
|
2019-09-19 11:35:30 -07:00
|
|
|
|
|
|
|
jobs:
|
2020-04-04 12:16:56 -07:00
|
|
|
- job: Build
|
2020-03-16 07:30:14 -07:00
|
|
|
displayName: 'Build'
|
2019-09-19 11:35:30 -07:00
|
|
|
|
2020-03-16 07:30:14 -07:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-03-16 07:49:56 -07:00
|
|
|
Development:
|
|
|
|
BuildConfiguration: development
|
2020-03-16 10:12:05 -07:00
|
|
|
Production:
|
|
|
|
BuildConfiguration: production
|
2020-03-16 07:49:56 -07:00
|
|
|
Standalone:
|
|
|
|
BuildConfiguration: standalone
|
2020-03-16 07:30:14 -07:00
|
|
|
|
2020-04-04 12:16:17 -07:00
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
2019-09-19 11:35:30 -07:00
|
|
|
steps:
|
|
|
|
- task: NodeTool@0
|
2020-01-11 08:06:25 -07:00
|
|
|
displayName: 'Install Node'
|
2019-09-19 11:35:30 -07:00
|
|
|
inputs:
|
2020-03-28 03:36:58 -07:00
|
|
|
versionSpec: '12.x'
|
2019-09-19 11:35:30 -07:00
|
|
|
|
2020-03-16 08:17:46 -07:00
|
|
|
- task: Cache@2
|
2020-03-16 08:43:13 -07:00
|
|
|
displayName: 'Check Cache'
|
2020-03-16 08:17:46 -07:00
|
|
|
inputs:
|
|
|
|
key: 'yarn | yarn.lock'
|
2020-03-16 09:02:11 -07:00
|
|
|
path: 'node_modules'
|
2020-03-16 09:49:43 -07:00
|
|
|
cacheHitVar: CACHE_RESTORED
|
2020-03-16 08:17:46 -07:00
|
|
|
|
2020-03-16 11:05:18 -07:00
|
|
|
- script: 'yarn install --frozen-lockfile'
|
2020-03-16 08:43:13 -07:00
|
|
|
displayName: 'Install Dependencies'
|
2020-03-16 09:49:43 -07:00
|
|
|
condition: ne(variables.CACHE_RESTORED, 'true')
|
2020-03-16 08:43:13 -07:00
|
|
|
|
2020-03-16 09:09:25 -07:00
|
|
|
- script: 'yarn build:development'
|
2020-03-16 08:04:52 -07:00
|
|
|
displayName: 'Build Development'
|
|
|
|
condition: eq(variables['BuildConfiguration'], 'development')
|
|
|
|
|
2020-03-16 10:12:05 -07:00
|
|
|
- script: 'yarn build:production'
|
2020-03-16 07:49:56 -07:00
|
|
|
displayName: 'Build Bundle'
|
2020-03-16 10:12:05 -07:00
|
|
|
condition: eq(variables['BuildConfiguration'], 'production')
|
2020-03-16 07:49:56 -07:00
|
|
|
|
2020-03-16 09:09:25 -07:00
|
|
|
- script: 'yarn build:standalone'
|
2020-03-16 07:49:56 -07:00
|
|
|
displayName: 'Build Standalone'
|
|
|
|
condition: eq(variables['BuildConfiguration'], 'standalone')
|
2020-02-28 07:15:22 -07:00
|
|
|
|
2020-01-11 08:06:25 -07:00
|
|
|
- script: 'test -d dist'
|
|
|
|
displayName: 'Check Build'
|
2019-10-03 08:00:41 -07:00
|
|
|
|
2020-03-16 07:49:56 -07:00
|
|
|
- script: 'mv dist jellyfin-web'
|
|
|
|
displayName: 'Rename Directory'
|
2019-09-19 11:35:30 -07:00
|
|
|
|
|
|
|
- task: PublishPipelineArtifact@1
|
2020-01-11 08:06:25 -07:00
|
|
|
displayName: 'Publish Release'
|
2019-09-19 11:35:30 -07:00
|
|
|
inputs:
|
2020-03-16 07:49:56 -07:00
|
|
|
targetPath: '$(Build.SourcesDirectory)/jellyfin-web'
|
|
|
|
artifactName: 'jellyfin-web-$(BuildConfiguration)'
|
2019-09-19 11:35:30 -07:00
|
|
|
|
2020-04-04 12:16:56 -07:00
|
|
|
- job: Lint
|
2019-09-19 11:35:30 -07:00
|
|
|
displayName: 'Lint'
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: NodeTool@0
|
2020-01-11 08:06:25 -07:00
|
|
|
displayName: 'Install Node'
|
2019-09-19 11:35:30 -07:00
|
|
|
inputs:
|
2020-03-28 03:36:58 -07:00
|
|
|
versionSpec: '12.x'
|
2019-09-19 11:35:30 -07:00
|
|
|
|
2020-03-16 10:17:12 -07:00
|
|
|
- task: Cache@2
|
|
|
|
displayName: 'Check Cache'
|
|
|
|
inputs:
|
|
|
|
key: 'yarn | yarn.lock'
|
|
|
|
path: 'node_modules'
|
|
|
|
cacheHitVar: CACHE_RESTORED
|
|
|
|
|
2020-03-16 11:05:18 -07:00
|
|
|
- script: 'yarn install --frozen-lockfile'
|
2020-01-11 08:06:25 -07:00
|
|
|
displayName: 'Install Dependencies'
|
2020-03-16 10:17:12 -07:00
|
|
|
condition: ne(variables.CACHE_RESTORED, 'true')
|
2019-09-19 11:35:30 -07:00
|
|
|
|
2020-04-02 11:34:48 -07:00
|
|
|
- script: 'yarn run lint --quiet'
|
2019-09-19 11:35:30 -07:00
|
|
|
displayName: 'Run ESLint'
|
2020-01-19 08:05:35 -07:00
|
|
|
|
2020-03-16 07:30:14 -07:00
|
|
|
- script: 'yarn run stylelint'
|
|
|
|
displayName: 'Run Stylelint'
|