jellyfin/.ci/azure-pipelines-api-client.yml

63 lines
2.0 KiB
YAML
Raw Normal View History

2020-09-05 22:32:21 -07:00
parameters:
- name: LinuxImage
type: string
default: "ubuntu-latest"
- name: GeneratorVersion
type: string
default: "4.3.1"
jobs:
- job: GenerateApiClients
displayName: 'Generate Api Clients'
2020-10-02 07:00:57 -07:00
dependsOn: Test
2020-09-05 22:32:21 -07:00
pool:
vmImage: "${{ parameters.LinuxImage }}"
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download OpenAPI Spec Artifact'
inputs:
2020-10-02 06:00:57 -07:00
source: 'current'
2020-09-05 22:32:21 -07:00
artifact: "OpenAPI Spec"
2020-10-02 06:00:57 -07:00
path: "$(System.ArtifactsDirectory)/openapispec"
runVersion: "latest"
2020-09-05 22:32:21 -07:00
- task: CmdLine@2
2020-10-02 07:00:57 -07:00
displayName: 'Download OpenApi Generator'
inputs:
script: "wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/${{ parameters.GeneratorVersion }}/openapi-generator-cli-${{ parameters.GeneratorVersion }}.jar -O openapi-generator-cli.jar"
2020-09-05 22:32:21 -07:00
# Generate npm api client
# Unstable
- task: CmdLine@2
2020-10-02 07:00:57 -07:00
displayName: 'Build unstable typescript axios client'
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
script: 'bash ./apiclient/templates/typescript/axios/unstable.sh'
2020-09-05 22:32:21 -07:00
- task: Npm@1
2020-10-02 07:00:57 -07:00
displayName: 'Publish unstable typescript axios client'
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
command: publish
publishRegistry: useFeed
publishFeed: unstable
workingDir: ./apiclient/generated/typescript/axios
2020-09-05 22:32:21 -07:00
# Stable
- task: CmdLine@2
2020-10-02 07:00:57 -07:00
displayName: 'Build stable typescript axios client'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
inputs:
script: 'bash ./apiclient/templates/typescript/axios/stable.sh'
2020-09-05 22:32:21 -07:00
- task: Npm@1
2020-10-02 07:00:57 -07:00
displayName: 'Publish stable typescript axios client'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
inputs:
command: publish
publishRegistry: useExternalRegistry
publishEndpoint: 'jellyfin-bot for NPM'
workingDir: ./apiclient/generated/typescript/axios