Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add css linting and lint workflow to github action #96

Merged
merged 5 commits into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
360 changes: 167 additions & 193 deletions .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,197 +1,171 @@
trigger:
batch: true
branches:
include:
- '*'
tags:
include:
- '*'
batch: true
branches:
include:
- '*'
tags:
include:
- '*'
pr:
branches:
include:
- '*'
branches:
include:
- '*'

jobs:
- job: Build
displayName: 'Build'

strategy:
matrix:
Development:
BuildConfiguration: development
Production:
BuildConfiguration: production

pool:
vmImage: 'ubuntu-latest'

steps:
- task: NodeTool@0
displayName: 'Install Node'
inputs:
versionSpec: '12.x'

- task: Cache@2
displayName: 'Check Cache'
inputs:
key: 'yarn | yarn.lock'
path: 'node_modules'
cacheHitVar: CACHE_RESTORED

- script: 'yarn install --frozen-lockfile'
displayName: 'Install Dependencies'
condition: ne(variables.CACHE_RESTORED, 'true')

- script: 'sh ./scripts/updateversion.sh'
displayName: 'Update version in package.json'

- script: 'yarn build:development'
displayName: 'Build Development'
condition: eq(variables['BuildConfiguration'], 'development')

- script: 'yarn build:production'
displayName: 'Build Bundle'
condition: eq(variables['BuildConfiguration'], 'production')

- script: 'test -d dist'
displayName: 'Check Build'

- script: 'mv dist jellyfin-chromecast'
displayName: 'Rename Directory'

- task: ArchiveFiles@2
displayName: 'Archive Directory'
inputs:
rootFolderOrFile: 'jellyfin-chromecast'
includeRootFolder: true
archiveFile: 'jellyfin-chromecast-$(BuildConfiguration)'

- task: PublishPipelineArtifact@1
displayName: 'Publish Release'
inputs:
targetPath: '$(Build.SourcesDirectory)/jellyfin-chromecast-$(BuildConfiguration).zip'
artifactName: 'jellyfin-chromecast-$(BuildConfiguration)'

- job: Lint
displayName: 'Lint'

pool:
vmImage: 'ubuntu-latest'

steps:
- task: NodeTool@0
displayName: 'Install Node'
inputs:
versionSpec: '12.x'

- task: Cache@2
displayName: 'Check Cache'
inputs:
key: 'yarn | yarn.lock'
path: 'node_modules'
cacheHitVar: CACHE_RESTORED

- script: 'yarn install --frozen-lockfile'
displayName: 'Install Dependencies'
condition: ne(variables.CACHE_RESTORED, 'true')

- script: 'yarn run lint --quiet'
displayName: 'Run ESLint'

- job: Publish
displayName: 'Publish'

dependsOn: Build
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/tags'))

strategy:
matrix:
Development:
BuildConfiguration: development
Production:
BuildConfiguration: production

pool:
vmImage: 'ubuntu-latest'

steps:
- script: 'echo "##vso[task.setvariable variable=TAG]$(git describe --tags)"'
displayName: 'Set Tag Variable'

- task: DownloadPipelineArtifact@2
displayName: 'Download Artifact'
inputs:
source: 'current'
artifact: 'jellyfin-chromecast-$(BuildConfiguration)'
path: '$(System.ArtifactsDirectory)'
runVersion: 'latest'

- task: GithubRelease@0
displayName: 'GitHub Upload'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
inputs:
gitHubConnection: Jellyfin Release Download
repositoryName: jellyfin/jellyfin-chromecast
assets: '$(System.ArtifactsDirectory)/*.zip'
action: 'edit'
assetUploadMode: 'replace'
tag: '$(TAG)'

- task: CopyFilesOverSSH@0
displayName: 'Upload to Repository'
inputs:
sshEndpoint: repository
sourceFolder: '$(System.ArtifactsDirectory)'
contents: '**'
targetFolder: '/srv/repository/releases/client/chromecast/versions/$(TAG)'

- task: SSH@0
displayName: 'Symlink Latest Version'
inputs:
sshEndpoint: repository
runOptions: 'inline'
inline: 'cd /srv/repository/releases/client/chromecast && rm -rf *.zip && ln -s versions/$(TAG)/jellyfin-chromecast-$(BuildConfiguration)-$(TAG).zip .'

- job: Production
displayName: 'Production'

dependsOn: Build
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/tags'))

pool:
vmImage: 'ubuntu-latest'

steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Artifact'
inputs:
source: 'current'
artifact: 'jellyfin-chromecast-production'
path: '$(System.ArtifactsDirectory)'
runVersion: 'latest'

- task: ExtractFiles@1
displayName: "Extract Source"
inputs:
archiveFilePatterns: '$(System.ArtifactsDirectory)/*.zip'
destinationFolder: '$(System.ArtifactsDirectory)/artifact'
cleanDestinationFolder: true

- task: CopyFilesOverSSH@0
displayName: 'Update Nightly'
inputs:
sshEndpoint: chromecast
sourceFolder: '$(System.ArtifactsDirectory)/artifact/jellyfin-chromecast'
cleanTargetFolder: true
contents: '**'
targetFolder: '/srv/chromecast/nightly'

- task: CopyFilesOverSSH@0
displayName: 'Update Stable'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
inputs:
sshEndpoint: chromecast
sourceFolder: '$(System.ArtifactsDirectory)/artifact/jellyfin-chromecast'
cleanTargetFolder: true
contents: '**'
targetFolder: '/srv/chromecast/stable'
- job: Build
displayName: 'Build'

strategy:
matrix:
Development:
BuildConfiguration: development
Production:
BuildConfiguration: production

pool:
vmImage: 'ubuntu-latest'

steps:
- task: NodeTool@0
displayName: 'Install Node'
inputs:
versionSpec: '12.x'

- task: Cache@2
displayName: 'Check Cache'
inputs:
key: 'yarn | yarn.lock'
path: 'node_modules'
cacheHitVar: CACHE_RESTORED

- script: 'yarn install --frozen-lockfile'
displayName: 'Install Dependencies'
condition: ne(variables.CACHE_RESTORED, 'true')

- script: 'sh ./scripts/updateversion.sh'
displayName: 'Update version in package.json'

- script: 'yarn build:development'
displayName: 'Build Development'
condition: eq(variables['BuildConfiguration'], 'development')

- script: 'yarn build:production'
displayName: 'Build Bundle'
condition: eq(variables['BuildConfiguration'], 'production')

- script: 'test -d dist'
displayName: 'Check Build'

- script: 'mv dist jellyfin-chromecast'
displayName: 'Rename Directory'

- task: ArchiveFiles@2
displayName: 'Archive Directory'
inputs:
rootFolderOrFile: 'jellyfin-chromecast'
includeRootFolder: true
archiveFile: 'jellyfin-chromecast-$(BuildConfiguration)'

- task: PublishPipelineArtifact@1
displayName: 'Publish Release'
inputs:
targetPath: '$(Build.SourcesDirectory)/jellyfin-chromecast-$(BuildConfiguration).zip'
artifactName: 'jellyfin-chromecast-$(BuildConfiguration)'

- job: Publish
displayName: 'Publish'

dependsOn: Build
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/tags'))

strategy:
matrix:
Development:
BuildConfiguration: development
Production:
BuildConfiguration: production

pool:
vmImage: 'ubuntu-latest'

steps:
- script: 'echo "##vso[task.setvariable variable=TAG]$(git describe --tags)"'
displayName: 'Set Tag Variable'

- task: DownloadPipelineArtifact@2
displayName: 'Download Artifact'
inputs:
source: 'current'
artifact: 'jellyfin-chromecast-$(BuildConfiguration)'
path: '$(System.ArtifactsDirectory)'
runVersion: 'latest'

- task: GithubRelease@0
displayName: 'GitHub Upload'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
inputs:
gitHubConnection: Jellyfin Release Download
repositoryName: jellyfin/jellyfin-chromecast
assets: '$(System.ArtifactsDirectory)/*.zip'
action: 'edit'
assetUploadMode: 'replace'
tag: '$(TAG)'

- task: CopyFilesOverSSH@0
displayName: 'Upload to Repository'
inputs:
sshEndpoint: repository
sourceFolder: '$(System.ArtifactsDirectory)'
contents: '**'
targetFolder: '/srv/repository/releases/client/chromecast/versions/$(TAG)'

- task: SSH@0
displayName: 'Symlink Latest Version'
inputs:
sshEndpoint: repository
runOptions: 'inline'
inline: 'cd /srv/repository/releases/client/chromecast && rm -rf *.zip && ln -s versions/$(TAG)/jellyfin-chromecast-$(BuildConfiguration)-$(TAG).zip .'

- job: Production
displayName: 'Production'

dependsOn: Build
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/tags'))

pool:
vmImage: 'ubuntu-latest'

steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Artifact'
inputs:
source: 'current'
artifact: 'jellyfin-chromecast-production'
path: '$(System.ArtifactsDirectory)'
runVersion: 'latest'

- task: ExtractFiles@1
displayName: 'Extract Source'
inputs:
archiveFilePatterns: '$(System.ArtifactsDirectory)/*.zip'
destinationFolder: '$(System.ArtifactsDirectory)/artifact'
cleanDestinationFolder: true

- task: CopyFilesOverSSH@0
displayName: 'Update Nightly'
inputs:
sshEndpoint: chromecast
sourceFolder: '$(System.ArtifactsDirectory)/artifact/jellyfin-chromecast'
cleanTargetFolder: true
contents: '**'
targetFolder: '/srv/chromecast/nightly'

- task: CopyFilesOverSSH@0
displayName: 'Update Stable'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
inputs:
sshEndpoint: chromecast
sourceFolder: '$(System.ArtifactsDirectory)/artifact/jellyfin-chromecast'
cleanTargetFolder: true
contents: '**'
targetFolder: '/srv/chromecast/stable'
Loading