azure-pipelines-api-client.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. parameters:
  2. - name: LinuxImage
  3. type: string
  4. default: "ubuntu-latest"
  5. - name: GeneratorVersion
  6. type: string
  7. default: "5.0.1"
  8. jobs:
  9. - job: GenerateApiClients
  10. displayName: 'Generate Api Clients'
  11. condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
  12. dependsOn: Test
  13. pool:
  14. vmImage: "${{ parameters.LinuxImage }}"
  15. steps:
  16. - task: DownloadPipelineArtifact@2
  17. displayName: 'Download OpenAPI Spec Artifact'
  18. inputs:
  19. source: 'current'
  20. artifact: "OpenAPI Spec"
  21. path: "$(System.ArtifactsDirectory)/openapispec"
  22. runVersion: "latest"
  23. - task: CmdLine@2
  24. displayName: 'Download OpenApi Generator'
  25. inputs:
  26. 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"
  27. ## Authenticate with npm registry
  28. - task: npmAuthenticate@0
  29. inputs:
  30. workingFile: ./.npmrc
  31. customEndpoint: 'jellyfin-bot for NPM'
  32. ## Generate npm api client
  33. - task: CmdLine@2
  34. displayName: 'Build stable typescript axios client'
  35. inputs:
  36. script: "bash ./apiclient/templates/typescript/axios/generate.sh $(System.ArtifactsDirectory)"
  37. ## Run npm install
  38. - task: Npm@1
  39. displayName: 'Install npm dependencies'
  40. inputs:
  41. command: install
  42. workingDir: ./apiclient/generated/typescript/axios
  43. ## Publish npm packages
  44. - task: Npm@1
  45. displayName: 'Publish stable typescript axios client'
  46. inputs:
  47. command: custom
  48. customCommand: publish --access public
  49. publishRegistry: useExternalRegistry
  50. publishEndpoint: 'jellyfin-bot for NPM'
  51. workingDir: ./apiclient/generated/typescript/axios