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

60 lines
1.8 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
2021-02-09 19:02:02 -07:00
default: "5.0.1"
2020-09-05 22:32:21 -07:00
jobs:
- job: GenerateApiClients
displayName: 'Generate Api Clients'
2020-11-13 08:02:45 -07:00
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
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
2020-10-14 17:16:58 -07:00
## Authenticate with npm registry
- task: npmAuthenticate@0
inputs:
workingFile: ./.npmrc
customEndpoint: 'jellyfin-bot for NPM'
2020-10-09 08:52:05 -07:00
## Generate npm api client
- task: CmdLine@2
displayName: 'Build stable typescript axios client'
inputs:
script: "bash ./apiclient/templates/typescript/axios/generate.sh $(System.ArtifactsDirectory)"
## Run npm install
- task: Npm@1
displayName: 'Install npm dependencies'
inputs:
command: install
workingDir: ./apiclient/generated/typescript/axios
## Publish npm packages
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'
inputs:
2020-12-04 23:25:41 -07:00
command: custom
customCommand: publish --access public
2020-10-02 07:00:57 -07:00
publishRegistry: useExternalRegistry
publishEndpoint: 'jellyfin-bot for NPM'
workingDir: ./apiclient/generated/typescript/axios