2020-06-19 16:25:11 -04:00
jobs :
- job : BuildPackage
displayName : 'Build Packages'
strategy :
matrix :
CentOS.amd64 :
BuildConfiguration : centos.amd64
Fedora.amd64 :
BuildConfiguration : fedora.amd64
Debian.amd64 :
BuildConfiguration : debian.amd64
Debian.arm64 :
BuildConfiguration : debian.arm64
Debian.armhf :
BuildConfiguration : debian.armhf
Ubuntu.amd64 :
BuildConfiguration : ubuntu.amd64
Ubuntu.arm64 :
BuildConfiguration : ubuntu.arm64
Ubuntu.armhf :
BuildConfiguration : ubuntu.armhf
Linux.amd64 :
BuildConfiguration : linux.amd64
2020-12-19 15:57:08 -05:00
Linux.amd64-musl :
BuildConfiguration : linux.amd64-musl
Linux.arm64 :
BuildConfiguration : linux.arm64
2022-08-28 22:28:15 -04:00
Linux.musl-linux-arm64 :
BuildConfiguration : linux.musl-linux-arm64
2020-12-19 15:57:08 -05:00
Linux.armhf :
BuildConfiguration : linux.armhf
2020-06-19 16:25:11 -04:00
Windows.amd64 :
BuildConfiguration : windows.amd64
2022-12-07 19:51:29 -05:00
MacOS.amd64 :
BuildConfiguration : macos.amd64
MacOS.arm64 :
BuildConfiguration : macos.arm64
2020-06-19 16:25:11 -04:00
Portable :
BuildConfiguration : portable
pool :
vmImage : 'ubuntu-latest'
steps :
2021-12-11 14:50:55 -05:00
- script : echo "##vso[task.setvariable variable=JellyfinVersion]$( awk -F '/' '{ print $NF }' <<<'$(Build.SourceBranch)' | sed 's/^v//' )"
displayName : Set release version (stable)
condition : startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
2023-06-27 23:20:41 -04:00
- script : 'docker build -f deployment/Dockerfile.$(BuildConfiguration) -t jellyfin-server-$(BuildConfiguration) --label "org.opencontainers.image.url=$(Build.Repository.Uri)" --label "org.opencontainers.image.revision=$(Build.SourceVersion)" deployment'
2020-06-19 16:25:11 -04:00
displayName : 'Build Dockerfile'
- script : 'docker image ls -a && docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e IS_UNSTABLE="yes" -e BUILD_ID=$(Build.BuildNumber) jellyfin-server-$(BuildConfiguration)'
displayName : 'Run Dockerfile (unstable)'
2020-06-20 15:03:25 -04:00
condition : startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
2020-06-19 16:25:11 -04:00
- script : 'docker image ls -a && docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e IS_UNSTABLE="no" -e BUILD_ID=$(Build.BuildNumber) jellyfin-server-$(BuildConfiguration)'
displayName : 'Run Dockerfile (stable)'
2020-09-02 16:53:33 -04:00
condition : startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
2020-06-19 16:25:11 -04:00
- task : PublishPipelineArtifact@1
displayName : 'Publish Release'
inputs :
targetPath : '$(Build.SourcesDirectory)/deployment/dist'
artifactName : 'jellyfin-server-$(BuildConfiguration)'
2020-07-13 14:36:07 -04:00
- task : SSH@0
displayName : 'Create target directory on repository server'
inputs :
sshEndpoint : repository
runOptions : 'inline'
inline : 'mkdir -p /srv/repository/incoming/azure/$(Build.BuildNumber)/$(BuildConfiguration)'
2022-10-26 09:27:07 -04:00
- task : CopyFilesOverSSH@0
2020-06-19 16:25:11 -04:00
displayName : 'Upload artifacts to repository server'
inputs :
sshEndpoint : repository
sourceFolder : '$(Build.SourcesDirectory)/deployment/dist'
contents : '**'
2020-11-06 12:00:00 -05:00
targetFolder : '/srv/repository/incoming/azure/$(Build.BuildNumber)/$(BuildConfiguration)'
2020-10-01 11:57:40 -04:00
- 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 :
2021-12-11 14:50:55 -05:00
- script : echo "##vso[task.setvariable variable=JellyfinVersion]$( awk -F '/' '{ print $NF }' <<<'$(Build.SourceBranch)' | sed 's/^v//' )"
displayName : Set release version (stable)
condition : startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
2022-10-26 09:27:07 -04:00
- task : DownloadPipelineArtifact@2
2020-10-01 11:57:40 -04:00
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)'
2022-10-26 09:27:07 -04:00
- task : CopyFilesOverSSH@0
2020-10-01 11:57:40 -04:00
displayName : 'Upload artifacts to repository server'
inputs :
sshEndpoint : repository
sourceFolder : '$(System.ArtifactsDirectory)/openapispec'
contents : 'openapi.json'
targetFolder : '/srv/repository/incoming/azure/$(Build.BuildNumber)'
2020-06-19 16:25:11 -04:00
- job : BuildDocker
displayName : 'Build Docker'
2020-06-19 17:20:48 -04:00
strategy :
matrix :
2020-06-19 17:33:07 -04:00
amd64 :
2020-06-19 17:20:48 -04:00
BuildConfiguration : amd64
2020-06-19 17:33:07 -04:00
arm64 :
2020-06-19 17:20:48 -04:00
BuildConfiguration : arm64
2020-06-19 17:33:07 -04:00
armhf :
2020-06-19 17:20:48 -04:00
BuildConfiguration : armhf
2020-06-19 16:25:11 -04:00
pool :
vmImage : 'ubuntu-latest'
2020-07-27 21:35:57 -04:00
variables :
- name : JellyfinVersion
value : 0.0 .0
2020-06-19 16:25:11 -04:00
steps :
2020-07-28 00:21:30 -04:00
- script : echo "##vso[task.setvariable variable=JellyfinVersion]$( awk -F '/' '{ print $NF }' <<<'$(Build.SourceBranch)' | sed 's/^v//' )"
2020-07-27 21:35:57 -04:00
displayName : Set release version (stable)
2020-09-02 16:53:33 -04:00
condition : startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
2020-07-27 21:35:57 -04:00
2022-10-26 09:27:07 -04:00
- task : Docker@2
2020-06-19 16:25:11 -04:00
displayName : 'Push Unstable Image'
2020-06-20 15:03:25 -04:00
condition : startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
2020-06-19 16:25:11 -04:00
inputs :
repository : 'jellyfin/jellyfin-server'
command : buildAndPush
buildContext : '.'
2020-06-19 17:20:48 -04:00
Dockerfile : 'deployment/Dockerfile.docker.$(BuildConfiguration)'
2020-06-19 16:25:11 -04:00
containerRegistry : Docker Hub
tags : |
2020-06-19 17:20:48 -04:00
unstable-$(Build.BuildNumber)-$(BuildConfiguration)
unstable-$(BuildConfiguration)
2020-06-19 16:25:11 -04:00
2022-10-26 09:27:07 -04:00
- task : Docker@2
2020-06-19 16:25:11 -04:00
displayName : 'Push Stable Image'
2020-09-02 16:53:33 -04:00
condition : startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
2020-06-19 16:25:11 -04:00
inputs :
repository : 'jellyfin/jellyfin-server'
command : buildAndPush
buildContext : '.'
2020-06-19 17:20:48 -04:00
Dockerfile : 'deployment/Dockerfile.docker.$(BuildConfiguration)'
2020-06-19 16:25:11 -04:00
containerRegistry : Docker Hub
tags : |
2020-06-19 17:20:48 -04:00
stable-$(Build.BuildNumber)-$(BuildConfiguration)
2020-07-27 21:35:57 -04:00
$(JellyfinVersion)-$(BuildConfiguration)
2020-06-19 16:25:11 -04:00
- job : CollectArtifacts
2020-08-10 06:24:56 -04:00
timeoutInMinutes : 20
2020-06-19 16:25:11 -04:00
displayName : 'Collect Artifacts'
2020-08-10 06:24:56 -04:00
continueOnError : true
2020-06-19 16:25:11 -04:00
dependsOn :
- BuildPackage
- BuildDocker
pool :
vmImage : 'ubuntu-latest'
steps :
- task : SSH@0
displayName : 'Update Unstable Repository'
2020-08-10 06:24:56 -04:00
continueOnError : true
2020-06-20 15:03:25 -04:00
condition : startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
2020-06-19 16:25:11 -04:00
inputs :
sshEndpoint : repository
2020-07-31 18:20:47 -04:00
runOptions : 'commands'
2020-11-06 13:00:59 -05:00
commands : nohup sudo /srv/repository/collect-server.azure.sh /srv/repository/incoming/azure $(Build.BuildNumber) unstable &
2020-06-19 16:25:11 -04:00
- task : SSH@0
2020-09-02 16:42:00 -04:00
displayName : 'Update Stable Repository'
2020-08-10 06:24:56 -04:00
continueOnError : true
2020-09-02 16:53:33 -04:00
condition : startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
2020-06-19 16:25:11 -04:00
inputs :
sshEndpoint : repository
2020-07-31 18:32:25 -04:00
runOptions : 'commands'
2021-11-13 14:45:02 -05:00
commands : nohup sudo /srv/repository/collect-server.azure.sh /srv/repository/incoming/azure $(Build.BuildNumber) $(Build.SourceBranch) &
2020-09-02 16:42:00 -04:00
2020-07-19 13:59:07 -04:00
- job : PublishNuget
displayName : 'Publish NuGet packages'
2020-07-31 18:20:47 -04:00
2020-07-19 13:59:07 -04:00
pool :
vmImage : 'ubuntu-latest'
2021-01-01 08:56:14 -05:00
variables :
- name : JellyfinVersion
2021-01-05 17:01:46 -05:00
value : $[replace(variables['Build.SourceBranch'],'refs/tags/v','')]
2021-01-01 08:56:14 -05:00
2020-07-19 13:59:07 -04:00
steps :
2020-11-16 23:27:14 -05:00
- task : UseDotNet@2
2022-11-09 09:28:52 -05:00
displayName : 'Use .NET 7.0 sdk'
2020-11-16 23:27:14 -05:00
inputs :
packageType : 'sdk'
2022-11-09 09:28:52 -05:00
version : '7.0.x'
2020-11-16 23:27:14 -05:00
2022-10-26 09:27:07 -04:00
- task : DotNetCoreCLI@2
2020-08-13 13:03:47 -04:00
displayName : 'Build Stable Nuget packages'
2020-09-02 16:53:33 -04:00
condition : startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
2020-07-19 13:59:07 -04:00
inputs :
2021-01-01 08:56:14 -05:00
command : 'custom'
projects : |
Jellyfin.Data/Jellyfin.Data.csproj
MediaBrowser.Common/MediaBrowser.Common.csproj
MediaBrowser.Controller/MediaBrowser.Controller.csproj
MediaBrowser.Model/MediaBrowser.Model.csproj
Emby.Naming/Emby.Naming.csproj
2021-09-21 19:04:27 -04:00
src/Jellyfin.Extensions/Jellyfin.Extensions.csproj
2021-01-01 08:56:14 -05:00
custom : 'pack'
arguments : -o $(Build.ArtifactStagingDirectory) -p:Version=$(JellyfinVersion)
2020-07-19 13:59:07 -04:00
2022-10-26 09:27:07 -04:00
- task : DotNetCoreCLI@2
2020-08-13 13:03:47 -04:00
displayName : 'Build Unstable Nuget packages'
2020-12-24 04:18:32 -05:00
condition : startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
2020-08-13 13:03:47 -04:00
inputs :
command : 'custom'
projects : |
Jellyfin.Data/Jellyfin.Data.csproj
MediaBrowser.Common/MediaBrowser.Common.csproj
MediaBrowser.Controller/MediaBrowser.Controller.csproj
MediaBrowser.Model/MediaBrowser.Model.csproj
Emby.Naming/Emby.Naming.csproj
2021-09-21 19:04:27 -04:00
src/Jellyfin.Extensions/Jellyfin.Extensions.csproj
2020-08-13 13:03:47 -04:00
custom : 'pack'
2020-09-02 16:42:00 -04:00
arguments : '--version-suffix $(Build.BuildNumber) -o $(Build.ArtifactStagingDirectory) -p:Stability=Unstable'
2020-08-13 13:03:47 -04:00
2020-08-13 09:35:56 -04:00
- task : PublishBuildArtifacts@1
2020-08-13 13:03:47 -04:00
displayName : 'Publish Nuget packages'
2020-08-13 09:35:56 -04:00
inputs :
pathToPublish : $(Build.ArtifactStagingDirectory)
artifactName : Jellyfin Nuget Packages
2020-07-19 13:59:07 -04:00
- task : NuGetCommand@2
2020-09-02 16:42:00 -04:00
displayName : 'Push Nuget packages to stable feed'
condition : startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
inputs :
command : 'push'
2021-01-01 08:56:14 -05:00
packagesToPush : '$(Build.ArtifactStagingDirectory)/**/*.nupkg'
2020-09-02 16:42:00 -04:00
nuGetFeedType : 'external'
publishFeedCredentials : 'NugetOrg'
allowPackageConflicts : true # This ignores an error if the version already exists
2022-10-26 09:27:07 -04:00
- task : NuGetAuthenticate@0
2020-09-02 16:42:00 -04:00
displayName : 'Authenticate to unstable Nuget feed'
condition : startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
- task : NuGetCommand@2
displayName : 'Push Nuget packages to unstable feed'
condition : startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
2020-07-19 13:59:07 -04:00
inputs :
command : 'push'
2020-09-02 16:42:00 -04:00
packagesToPush : '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' # No symbols since Azure Artifact does not support it
nuGetFeedType : 'internal'
publishVstsFeed : '7cce6c46-d610-45e3-9fb7-65a6bfd1b671/a5746b79-f369-42db-93ff-59cd066f9327'
allowPackageConflicts : true # This ignores an error if the version already exists