mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Merge pull request #367 from mcarlton00/artifact-name
Refactor pipeline
This commit is contained in:
commit
b89b9e0499
3 changed files with 53 additions and 23 deletions
|
@ -1,9 +1,20 @@
|
||||||
# Starter pipeline
|
trigger:
|
||||||
# Start with a minimal pipeline that you can customize to build and deploy your code.
|
batch: true
|
||||||
# Add steps that build, run tests, deploy, and more:
|
branches:
|
||||||
# https://aka.ms/yaml
|
include:
|
||||||
|
- '*'
|
||||||
|
tags:
|
||||||
|
include:
|
||||||
|
- '*'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
# On every PR, build the addon and make it available for download as an artifact
|
||||||
- template: build.yml
|
- template: build.yml
|
||||||
parameters:
|
parameters:
|
||||||
py_versions: [ 'py2', 'py3' ]
|
py_versions: [ 'py2', 'py3' ]
|
||||||
|
|
||||||
|
# When triggered by a tag, publish the built addon to the repo server
|
||||||
|
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags') }}:
|
||||||
|
- template: publish.yml
|
||||||
|
parameters:
|
||||||
|
py_versions: [ 'py2', 'py3' ]
|
||||||
|
|
|
@ -16,10 +16,26 @@ steps:
|
||||||
- script: python3 jellyfin-kodi/.config/generate_xml.py ${{ py_version }}
|
- script: python3 jellyfin-kodi/.config/generate_xml.py ${{ py_version }}
|
||||||
displayName: 'Create ${{ py_version }} addon.xml'
|
displayName: 'Create ${{ py_version }} addon.xml'
|
||||||
|
|
||||||
|
- task: CopyFiles@2
|
||||||
|
displayName: 'Create clean addon directory'
|
||||||
|
inputs:
|
||||||
|
sourceFolder: 'jellyfin-kodi'
|
||||||
|
contents: |
|
||||||
|
**/*
|
||||||
|
!.ci
|
||||||
|
!.config
|
||||||
|
!.git
|
||||||
|
!.github
|
||||||
|
!.gitignore
|
||||||
|
!requirements-dev.txt
|
||||||
|
!tests
|
||||||
|
!tox.ini
|
||||||
|
TargetFolder: '$(Build.ArtifactStagingDirectory)/plugin.video.jellyfin'
|
||||||
|
|
||||||
- task: ArchiveFiles@2
|
- task: ArchiveFiles@2
|
||||||
displayName: 'Create ${{ py_version }} zip file'
|
displayName: 'Create ${{ py_version }} zip file'
|
||||||
inputs:
|
inputs:
|
||||||
rootFolderOrFile: jellyfin-kodi
|
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/plugin.video.jellyfin'
|
||||||
includeRootFolder: False
|
includeRootFolder: False
|
||||||
archiveType: 'zip'
|
archiveType: 'zip'
|
||||||
tarCompression: 'none'
|
tarCompression: 'none'
|
||||||
|
@ -28,22 +44,6 @@ steps:
|
||||||
- task: PublishPipelineArtifact@1
|
- task: PublishPipelineArtifact@1
|
||||||
displayName: 'Publish ${{ py_version }} artifact'
|
displayName: 'Publish ${{ py_version }} artifact'
|
||||||
inputs:
|
inputs:
|
||||||
targetPath: '$(Build.ArtifactStagingDirectory)/plugin.video.jellyfin-${{ py_version }}.zip'
|
targetPath: '$(Build.ArtifactStagingDirectory)/plugin.video.jellyfin'
|
||||||
artifactName: 'plugin.video.jellyfin-${{ py_version }}-$(Build.BuildNumber).zip'
|
artifactName: 'plugin.video.jellyfin-${{ py_version }}-$(Build.BuildNumber)'
|
||||||
|
|
||||||
- task: CopyFilesOverSSH@0
|
|
||||||
displayName: 'Upload to repo server'
|
|
||||||
inputs:
|
|
||||||
sshEndpoint: repository
|
|
||||||
sourceFolder: '$(Build.ArtifactStagingDirectory)'
|
|
||||||
contents: 'plugin.video.jellyfin-${{ py_version }}.zip'
|
|
||||||
targetFolder: '/srv/repository/incoming/kodi'
|
|
||||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
|
|
||||||
|
|
||||||
- task: SSH@0
|
|
||||||
displayName: 'Add to Kodi repo'
|
|
||||||
inputs:
|
|
||||||
sshEndpoint: repository
|
|
||||||
runOptions: 'commands'
|
|
||||||
commands: 'sudo -n python3 /usr/local/bin/kodirepo add /srv/repository/incoming/kodi/plugin.video.jellyfin-${{ py_version }} --datadir /srv/repository/releases/client/kodi/${{ py_version }}'
|
|
||||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
|
|
||||||
|
|
19
.ci/publish.yml
Normal file
19
.ci/publish.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
parameters:
|
||||||
|
python_version : []
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- ${{ each py_version in parameters.py_versions }}:
|
||||||
|
- task: CopyFilesOverSSH@0
|
||||||
|
displayName: 'Upload to repo server'
|
||||||
|
inputs:
|
||||||
|
sshEndpoint: repository
|
||||||
|
sourceFolder: '$(Build.ArtifactStagingDirectory)'
|
||||||
|
contents: 'plugin.video.jellyfin-${{ py_version }}.zip'
|
||||||
|
targetFolder: '/srv/repository/incoming/kodi'
|
||||||
|
|
||||||
|
- task: SSH@0
|
||||||
|
displayName: 'Add to Kodi repo'
|
||||||
|
inputs:
|
||||||
|
sshEndpoint: repository
|
||||||
|
runOptions: 'commands'
|
||||||
|
commands: 'sudo -n python3 /usr/local/bin/kodirepo add /srv/repository/incoming/kodi/plugin.video.jellyfin-${{ py_version }} --datadir /srv/repository/releases/client/kodi/${{ py_version }}'
|
Loading…
Reference in a new issue