From 320e3b98ab50e83932156b1a8ce7fc25685f7252 Mon Sep 17 00:00:00 2001 From: crobibero Date: Sat, 5 Sep 2020 23:32:21 -0600 Subject: [PATCH 01/10] Add ci task to publish api client --- .ci/azure-pipelines-api-client.yml | 72 +++++++++++++++++++ .gitignore | 1 + apiclient/.openapi-generator-ignore | 2 + .../templates/typescript/package.mustache | 30 ++++++++ apiclient/templates/typescript/stable.sh | 10 +++ apiclient/templates/typescript/unstable.sh | 10 +++ 6 files changed, 125 insertions(+) create mode 100644 .ci/azure-pipelines-api-client.yml create mode 100644 apiclient/.openapi-generator-ignore create mode 100644 apiclient/templates/typescript/package.mustache create mode 100644 apiclient/templates/typescript/stable.sh create mode 100644 apiclient/templates/typescript/unstable.sh diff --git a/.ci/azure-pipelines-api-client.yml b/.ci/azure-pipelines-api-client.yml new file mode 100644 index 0000000000..babee15b5a --- /dev/null +++ b/.ci/azure-pipelines-api-client.yml @@ -0,0 +1,72 @@ +parameters: + - name: LinuxImage + type: string + default: "ubuntu-latest" + - name: GeneratorVersion + type: string + default: "4.3.1" + +jobs: +- job: GenerateApiClients + displayName: 'Generate Api Clients' + + pool: + vmImage: "${{ parameters.LinuxImage }}" + + steps: + - task: DownloadPipelineArtifact@2 + displayName: 'Download OpenAPI Spec Artifact' + inputs: + source: "specific" + artifact: "OpenAPI Spec" + path: "$(System.ArtifactsDirectory)/openapi" + project: "$(System.TeamProjectId)" + pipeline: "29" # The main server CI build + runVersion: "latestFromBranch" + runBranch: "refs/heads/$(System.PullRequest.TargetBranch)" + + - task: CmdLine@2 + displayName: 'Download OpenApi Generator' + inputs: + scripts: "wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/${{ parameters.GeneratorVersion }}/openapi-generator-cli-${{ parameters.GeneratorVersion }}.jar -O openapi-generator-cli.jar" + +# Generate npm api client +# Unstable + - task: npmAuthenticate@0 + displayName: 'Authenticate to unstable npm feed' + condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master') + + - task: CmdLine@2 + displayName: 'Build unstable typescript axios client' + condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master') + inputs: + script: 'bash ./apiclient/templates/typescript/unstable.sh axios' + + - task: Npm@1 + displayName: 'Publish unstable typescript axios client' + condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master') + inputs: + command: publish + publishRegistry: useFeed + publishFeed: jellyfin/unstable + workingDir: ./apiclient/generated/typescript/axios + +# Stable + - task: npmAuthenticate@0 + displayName: 'Authenticate to stable npm feed' + condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') + + - task: CmdLine@2 + displayName: 'Build stable typescript axios client' + condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') + inputs: + script: 'bash ./apiclient/templates/typescript/stable.sh axios' + + - task: Npm@1 + displayName: 'Publish stable typescript axios client' + condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') + inputs: + command: publish + publishRegistry: useExternalRegistry + publishEndpoint: + workingDir: ./apiclient/generated/typescript/axios diff --git a/.gitignore b/.gitignore index 0df7606ce9..7cd3d0068a 100644 --- a/.gitignore +++ b/.gitignore @@ -276,3 +276,4 @@ BenchmarkDotNet.Artifacts web/ web-src.* MediaBrowser.WebDashboard/jellyfin-web +apiclient/generated diff --git a/apiclient/.openapi-generator-ignore b/apiclient/.openapi-generator-ignore new file mode 100644 index 0000000000..f3802cf541 --- /dev/null +++ b/apiclient/.openapi-generator-ignore @@ -0,0 +1,2 @@ +# Prevent generator from creating these files: +git_push.sh diff --git a/apiclient/templates/typescript/package.mustache b/apiclient/templates/typescript/package.mustache new file mode 100644 index 0000000000..5127917a14 --- /dev/null +++ b/apiclient/templates/typescript/package.mustache @@ -0,0 +1,30 @@ +{ + "name": "jellyfin-apiclient-{{npmName}}", + "version": "10.7.0{{snapshotVersion}}", + "description": "Jellyfin api client using {{npmName}}", + "author": "Jellyfin Contributors", + "keywords": [ + "{{npmName}}", + "typescript", + "jellyfin" + ], + "license": "GPL-3.0-only", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "build": "tsc --outDir dist/", + "prepublishOnly": "npm run build" + }, + "dependencies": { + "axios": "^0.19.2" + }, + "devDependencies": { + "@types/node": "^12.11.5", + "typescript": "^3.6.4" + }{{#npmRepository}},{{/npmRepository}} +{{#npmRepository}} + "publishConfig": { + "registry": "{{npmRepository}}" + } +{{/npmRepository}} +} diff --git a/apiclient/templates/typescript/stable.sh b/apiclient/templates/typescript/stable.sh new file mode 100644 index 0000000000..46af6433f4 --- /dev/null +++ b/apiclient/templates/typescript/stable.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +CLIENT=$1 +openapi-generator generate \ + --input-spec $(System.ArtifactsDirectory)/openapi/openapi.json \ + --generator-name typescript-${CLIENT} \ + --output ./apiclient/generated/typescript/${CLIENT} \ + --template-dir ./apiclient/templates/typescript \ + --ignore-file-override ./apiclient/.openapi-generator-ignore \ + --additional-properties=useSingleRequestParameter="true",npmName="${CLIENT}" diff --git a/apiclient/templates/typescript/unstable.sh b/apiclient/templates/typescript/unstable.sh new file mode 100644 index 0000000000..255e20c4fc --- /dev/null +++ b/apiclient/templates/typescript/unstable.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +CLIENT=$1 +openapi-generator generate \ + --input-spec $(System.ArtifactsDirectory)/openapi/openapi.json \ + --generator-name typescript-${CLIENT} \ + --output ./apiclient/generated/typescript/${CLIENT} \ + --template-dir ./apiclient/templates/typescript \ + --ignore-file-override ./apiclient/.openapi-generator-ignore \ + --additional-properties=useSingleRequestParameter="true",npmName="${CLIENT}",snapshotVersion="-SNAPSHOT.$(Build.BuildNumber)",npmRepository="https://dev.azure.com/jellyfin-project/jellyfin/_packaging" From 6ffffa95a7cfa092bc4dd1b75e25f1010d0d8855 Mon Sep 17 00:00:00 2001 From: crobibero Date: Sun, 6 Sep 2020 08:26:36 -0600 Subject: [PATCH 02/10] Use jar directly --- .ci/azure-pipelines.yml | 3 +++ apiclient/templates/typescript/stable.sh | 2 +- apiclient/templates/typescript/unstable.sh | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index b417aae678..f3e515447d 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -55,3 +55,6 @@ jobs: - ${{ if or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master')) }}: - template: azure-pipelines-package.yml + +- ${{ if or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master')) }}: + - template: azure-pipelines-api-client.yml diff --git a/apiclient/templates/typescript/stable.sh b/apiclient/templates/typescript/stable.sh index 46af6433f4..f23a85cc96 100644 --- a/apiclient/templates/typescript/stable.sh +++ b/apiclient/templates/typescript/stable.sh @@ -1,7 +1,7 @@ #!/bin/bash CLIENT=$1 -openapi-generator generate \ +java -jar openapi-generator-cli.jar generate \ --input-spec $(System.ArtifactsDirectory)/openapi/openapi.json \ --generator-name typescript-${CLIENT} \ --output ./apiclient/generated/typescript/${CLIENT} \ diff --git a/apiclient/templates/typescript/unstable.sh b/apiclient/templates/typescript/unstable.sh index 255e20c4fc..3571c8ad5c 100644 --- a/apiclient/templates/typescript/unstable.sh +++ b/apiclient/templates/typescript/unstable.sh @@ -1,7 +1,7 @@ #!/bin/bash CLIENT=$1 -openapi-generator generate \ +java -jar openapi-generator-cli.jar generate \ --input-spec $(System.ArtifactsDirectory)/openapi/openapi.json \ --generator-name typescript-${CLIENT} \ --output ./apiclient/generated/typescript/${CLIENT} \ From 810ec0b672c06baa34782ccfb4b0b5cd51196662 Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 2 Oct 2020 07:00:57 -0600 Subject: [PATCH 03/10] Fix download api spec --- .ci/azure-pipelines-api-client.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.ci/azure-pipelines-api-client.yml b/.ci/azure-pipelines-api-client.yml index babee15b5a..0c741495f7 100644 --- a/.ci/azure-pipelines-api-client.yml +++ b/.ci/azure-pipelines-api-client.yml @@ -17,13 +17,11 @@ jobs: - task: DownloadPipelineArtifact@2 displayName: 'Download OpenAPI Spec Artifact' inputs: - source: "specific" + source: 'current' artifact: "OpenAPI Spec" - path: "$(System.ArtifactsDirectory)/openapi" - project: "$(System.TeamProjectId)" - pipeline: "29" # The main server CI build - runVersion: "latestFromBranch" - runBranch: "refs/heads/$(System.PullRequest.TargetBranch)" + path: "$(System.ArtifactsDirectory)/openapispec" + runVersion: "latest" + dependsOn: Test - task: CmdLine@2 displayName: 'Download OpenApi Generator' @@ -68,5 +66,5 @@ jobs: inputs: command: publish publishRegistry: useExternalRegistry - publishEndpoint: + publishEndpoint: workingDir: ./apiclient/generated/typescript/axios From 520acc11e6e1def24939527be8ccc186ded1c7b4 Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 2 Oct 2020 07:19:18 -0600 Subject: [PATCH 04/10] scope npm package name --- apiclient/templates/typescript/package.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiclient/templates/typescript/package.mustache b/apiclient/templates/typescript/package.mustache index 5127917a14..251a403836 100644 --- a/apiclient/templates/typescript/package.mustache +++ b/apiclient/templates/typescript/package.mustache @@ -1,5 +1,5 @@ { - "name": "jellyfin-apiclient-{{npmName}}", + "name": "@jellyfin/client-{{npmName}}", "version": "10.7.0{{snapshotVersion}}", "description": "Jellyfin api client using {{npmName}}", "author": "Jellyfin Contributors", From 7d992798fdbd1dbba7242d83f79d7fba0499d15c Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 2 Oct 2020 07:40:44 -0600 Subject: [PATCH 05/10] specify client specifically instead of through template --- .ci/azure-pipelines-api-client.yml | 4 ++-- .../templates/typescript/{ => axios}/package.mustache | 6 +++--- apiclient/templates/typescript/{ => axios}/stable.sh | 9 ++++----- apiclient/templates/typescript/axios/unstable.sh | 9 +++++++++ apiclient/templates/typescript/unstable.sh | 10 ---------- 5 files changed, 18 insertions(+), 20 deletions(-) rename apiclient/templates/typescript/{ => axios}/package.mustache (83%) rename apiclient/templates/typescript/{ => axios}/stable.sh (58%) create mode 100644 apiclient/templates/typescript/axios/unstable.sh delete mode 100644 apiclient/templates/typescript/unstable.sh diff --git a/.ci/azure-pipelines-api-client.yml b/.ci/azure-pipelines-api-client.yml index 0c741495f7..cbedcc6079 100644 --- a/.ci/azure-pipelines-api-client.yml +++ b/.ci/azure-pipelines-api-client.yml @@ -38,7 +38,7 @@ jobs: displayName: 'Build unstable typescript axios client' condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master') inputs: - script: 'bash ./apiclient/templates/typescript/unstable.sh axios' + script: 'bash ./apiclient/templates/typescript/axios/unstable.sh' - task: Npm@1 displayName: 'Publish unstable typescript axios client' @@ -58,7 +58,7 @@ jobs: displayName: 'Build stable typescript axios client' condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') inputs: - script: 'bash ./apiclient/templates/typescript/stable.sh axios' + script: 'bash ./apiclient/templates/typescript/axios/stable.sh' - task: Npm@1 displayName: 'Publish stable typescript axios client' diff --git a/apiclient/templates/typescript/package.mustache b/apiclient/templates/typescript/axios/package.mustache similarity index 83% rename from apiclient/templates/typescript/package.mustache rename to apiclient/templates/typescript/axios/package.mustache index 251a403836..7bfab08cbb 100644 --- a/apiclient/templates/typescript/package.mustache +++ b/apiclient/templates/typescript/axios/package.mustache @@ -1,10 +1,10 @@ { - "name": "@jellyfin/client-{{npmName}}", + "name": "@jellyfin/client-axios", "version": "10.7.0{{snapshotVersion}}", - "description": "Jellyfin api client using {{npmName}}", + "description": "Jellyfin api client using axios", "author": "Jellyfin Contributors", "keywords": [ - "{{npmName}}", + "axios", "typescript", "jellyfin" ], diff --git a/apiclient/templates/typescript/stable.sh b/apiclient/templates/typescript/axios/stable.sh similarity index 58% rename from apiclient/templates/typescript/stable.sh rename to apiclient/templates/typescript/axios/stable.sh index f23a85cc96..ecc55d2e79 100644 --- a/apiclient/templates/typescript/stable.sh +++ b/apiclient/templates/typescript/axios/stable.sh @@ -1,10 +1,9 @@ #!/bin/bash -CLIENT=$1 java -jar openapi-generator-cli.jar generate \ --input-spec $(System.ArtifactsDirectory)/openapi/openapi.json \ - --generator-name typescript-${CLIENT} \ - --output ./apiclient/generated/typescript/${CLIENT} \ - --template-dir ./apiclient/templates/typescript \ + --generator-name typescript-axios \ + --output ./apiclient/generated/typescript/axios \ + --template-dir ./apiclient/templates/typescript/axios \ --ignore-file-override ./apiclient/.openapi-generator-ignore \ - --additional-properties=useSingleRequestParameter="true",npmName="${CLIENT}" + --additional-properties=useSingleRequestParameter="true",npmName="axios" diff --git a/apiclient/templates/typescript/axios/unstable.sh b/apiclient/templates/typescript/axios/unstable.sh new file mode 100644 index 0000000000..615eb5b228 --- /dev/null +++ b/apiclient/templates/typescript/axios/unstable.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +java -jar openapi-generator-cli.jar generate \ + --input-spec $(System.ArtifactsDirectory)/openapi/openapi.json \ + --generator-name typescript-axios \ + --output ./apiclient/generated/typescript/axios \ + --template-dir ./apiclient/templates/typescript/axios \ + --ignore-file-override ./apiclient/.openapi-generator-ignore \ + --additional-properties=useSingleRequestParameter="true",npmName="axios",snapshotVersion="-SNAPSHOT.$(Build.BuildNumber)",npmRepository="https://dev.azure.com/jellyfin-project/jellyfin/_packaging" diff --git a/apiclient/templates/typescript/unstable.sh b/apiclient/templates/typescript/unstable.sh deleted file mode 100644 index 3571c8ad5c..0000000000 --- a/apiclient/templates/typescript/unstable.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -CLIENT=$1 -java -jar openapi-generator-cli.jar generate \ - --input-spec $(System.ArtifactsDirectory)/openapi/openapi.json \ - --generator-name typescript-${CLIENT} \ - --output ./apiclient/generated/typescript/${CLIENT} \ - --template-dir ./apiclient/templates/typescript \ - --ignore-file-override ./apiclient/.openapi-generator-ignore \ - --additional-properties=useSingleRequestParameter="true",npmName="${CLIENT}",snapshotVersion="-SNAPSHOT.$(Build.BuildNumber)",npmRepository="https://dev.azure.com/jellyfin-project/jellyfin/_packaging" From 75dada6308c2be5d0c35f679cbcd49f6b7bd0cb9 Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 2 Oct 2020 07:47:14 -0600 Subject: [PATCH 06/10] add withSeparateModelsAndApi --- apiclient/templates/typescript/axios/stable.sh | 2 +- apiclient/templates/typescript/axios/unstable.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apiclient/templates/typescript/axios/stable.sh b/apiclient/templates/typescript/axios/stable.sh index ecc55d2e79..70c6409fb6 100644 --- a/apiclient/templates/typescript/axios/stable.sh +++ b/apiclient/templates/typescript/axios/stable.sh @@ -6,4 +6,4 @@ java -jar openapi-generator-cli.jar generate \ --output ./apiclient/generated/typescript/axios \ --template-dir ./apiclient/templates/typescript/axios \ --ignore-file-override ./apiclient/.openapi-generator-ignore \ - --additional-properties=useSingleRequestParameter="true",npmName="axios" + --additional-properties=useSingleRequestParameter="true",withSeparateModelsAndApi="true",npmName="axios" diff --git a/apiclient/templates/typescript/axios/unstable.sh b/apiclient/templates/typescript/axios/unstable.sh index 615eb5b228..83e4ba228a 100644 --- a/apiclient/templates/typescript/axios/unstable.sh +++ b/apiclient/templates/typescript/axios/unstable.sh @@ -6,4 +6,4 @@ java -jar openapi-generator-cli.jar generate \ --output ./apiclient/generated/typescript/axios \ --template-dir ./apiclient/templates/typescript/axios \ --ignore-file-override ./apiclient/.openapi-generator-ignore \ - --additional-properties=useSingleRequestParameter="true",npmName="axios",snapshotVersion="-SNAPSHOT.$(Build.BuildNumber)",npmRepository="https://dev.azure.com/jellyfin-project/jellyfin/_packaging" + --additional-properties=useSingleRequestParameter="true",withSeparateModelsAndApi="true",npmName="axios",snapshotVersion="-SNAPSHOT.$(Build.BuildNumber)",npmRepository="https://dev.azure.com/jellyfin-project/jellyfin/_packaging" From 3d20ff69d4c711fcde794830c27f53df5d51941b Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 2 Oct 2020 07:50:38 -0600 Subject: [PATCH 07/10] Fix repo connections --- .ci/azure-pipelines-api-client.yml | 12 ++---------- apiclient/templates/typescript/axios/unstable.sh | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.ci/azure-pipelines-api-client.yml b/.ci/azure-pipelines-api-client.yml index cbedcc6079..dbd70c7028 100644 --- a/.ci/azure-pipelines-api-client.yml +++ b/.ci/azure-pipelines-api-client.yml @@ -30,10 +30,6 @@ jobs: # Generate npm api client # Unstable - - task: npmAuthenticate@0 - displayName: 'Authenticate to unstable npm feed' - condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master') - - task: CmdLine@2 displayName: 'Build unstable typescript axios client' condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master') @@ -46,14 +42,10 @@ jobs: inputs: command: publish publishRegistry: useFeed - publishFeed: jellyfin/unstable + publishFeed: unstable workingDir: ./apiclient/generated/typescript/axios # Stable - - task: npmAuthenticate@0 - displayName: 'Authenticate to stable npm feed' - condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') - - task: CmdLine@2 displayName: 'Build stable typescript axios client' condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') @@ -66,5 +58,5 @@ jobs: inputs: command: publish publishRegistry: useExternalRegistry - publishEndpoint: + publishEndpoint: 'jellyfin-bot for NPM' workingDir: ./apiclient/generated/typescript/axios diff --git a/apiclient/templates/typescript/axios/unstable.sh b/apiclient/templates/typescript/axios/unstable.sh index 83e4ba228a..5d85dc726c 100644 --- a/apiclient/templates/typescript/axios/unstable.sh +++ b/apiclient/templates/typescript/axios/unstable.sh @@ -6,4 +6,4 @@ java -jar openapi-generator-cli.jar generate \ --output ./apiclient/generated/typescript/axios \ --template-dir ./apiclient/templates/typescript/axios \ --ignore-file-override ./apiclient/.openapi-generator-ignore \ - --additional-properties=useSingleRequestParameter="true",withSeparateModelsAndApi="true",npmName="axios",snapshotVersion="-SNAPSHOT.$(Build.BuildNumber)",npmRepository="https://dev.azure.com/jellyfin-project/jellyfin/_packaging" + --additional-properties=useSingleRequestParameter="true",withSeparateModelsAndApi="true",npmName="axios",snapshotVersion="-SNAPSHOT.$(Build.BuildNumber)",npmRepository="https://pkgs.dev.azure.com/jellyfin-project/jellyfin/_packaging/unstable/npm/registry/" From 86e06369a93e6d7047646470e3755ad5df4c8974 Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 2 Oct 2020 08:00:57 -0600 Subject: [PATCH 08/10] fix liniting errors --- .ci/azure-pipelines-api-client.yml | 52 +++++++++++++++--------------- .ci/azure-pipelines.yml | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.ci/azure-pipelines-api-client.yml b/.ci/azure-pipelines-api-client.yml index dbd70c7028..f6e870674d 100644 --- a/.ci/azure-pipelines-api-client.yml +++ b/.ci/azure-pipelines-api-client.yml @@ -9,6 +9,7 @@ jobs: - job: GenerateApiClients displayName: 'Generate Api Clients' + dependsOn: Test pool: vmImage: "${{ parameters.LinuxImage }}" @@ -21,42 +22,41 @@ jobs: artifact: "OpenAPI Spec" path: "$(System.ArtifactsDirectory)/openapispec" runVersion: "latest" - dependsOn: Test - task: CmdLine@2 - displayName: 'Download OpenApi Generator' - inputs: - scripts: "wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/${{ parameters.GeneratorVersion }}/openapi-generator-cli-${{ parameters.GeneratorVersion }}.jar -O openapi-generator-cli.jar" + 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" # Generate npm api client # Unstable - task: CmdLine@2 - displayName: 'Build unstable typescript axios client' - condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master') - inputs: - script: 'bash ./apiclient/templates/typescript/axios/unstable.sh' + displayName: 'Build unstable typescript axios client' + condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master') + inputs: + script: 'bash ./apiclient/templates/typescript/axios/unstable.sh' - task: Npm@1 - 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 + 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 # Stable - task: CmdLine@2 - displayName: 'Build stable typescript axios client' - condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') - inputs: - script: 'bash ./apiclient/templates/typescript/axios/stable.sh' + displayName: 'Build stable typescript axios client' + condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') + inputs: + script: 'bash ./apiclient/templates/typescript/axios/stable.sh' - task: Npm@1 - 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 + 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 diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index f3e515447d..4c5db80c10 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -57,4 +57,4 @@ jobs: - template: azure-pipelines-package.yml - ${{ if or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master')) }}: - - template: azure-pipelines-api-client.yml + - template: azure-pipelines-api-client.yml From b95533d6a947306e92b02ff77d17fe07ca78e87c Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 2 Oct 2020 08:06:06 -0600 Subject: [PATCH 09/10] there I go changing paths again --- apiclient/templates/typescript/axios/stable.sh | 2 +- apiclient/templates/typescript/axios/unstable.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apiclient/templates/typescript/axios/stable.sh b/apiclient/templates/typescript/axios/stable.sh index 70c6409fb6..118ef219fe 100644 --- a/apiclient/templates/typescript/axios/stable.sh +++ b/apiclient/templates/typescript/axios/stable.sh @@ -1,7 +1,7 @@ #!/bin/bash java -jar openapi-generator-cli.jar generate \ - --input-spec $(System.ArtifactsDirectory)/openapi/openapi.json \ + --input-spec $(System.ArtifactsDirectory)/openapispec/openapi.json \ --generator-name typescript-axios \ --output ./apiclient/generated/typescript/axios \ --template-dir ./apiclient/templates/typescript/axios \ diff --git a/apiclient/templates/typescript/axios/unstable.sh b/apiclient/templates/typescript/axios/unstable.sh index 5d85dc726c..be9f9be438 100644 --- a/apiclient/templates/typescript/axios/unstable.sh +++ b/apiclient/templates/typescript/axios/unstable.sh @@ -1,7 +1,7 @@ #!/bin/bash java -jar openapi-generator-cli.jar generate \ - --input-spec $(System.ArtifactsDirectory)/openapi/openapi.json \ + --input-spec $(System.ArtifactsDirectory)/openapispec/openapi.json \ --generator-name typescript-axios \ --output ./apiclient/generated/typescript/axios \ --template-dir ./apiclient/templates/typescript/axios \ From 0ffc58e25509c375654430e64a2208baf6d65be9 Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Fri, 2 Oct 2020 08:21:28 -0600 Subject: [PATCH 10/10] Update .ci/azure-pipelines-api-client.yml Co-authored-by: Cameron --- .ci/azure-pipelines-api-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/azure-pipelines-api-client.yml b/.ci/azure-pipelines-api-client.yml index f6e870674d..7f428aec15 100644 --- a/.ci/azure-pipelines-api-client.yml +++ b/.ci/azure-pipelines-api-client.yml @@ -4,7 +4,7 @@ default: "ubuntu-latest" - name: GeneratorVersion type: string - default: "4.3.1" + default: "5.0.0-beta2" jobs: - job: GenerateApiClients