Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 8566f9c

Browse files
Merge pull request #112 from jellyfin/fix/pipeline
Fix/pipeline
2 parents 104dcfd + bcb3197 commit 8566f9c

3 files changed

Lines changed: 186 additions & 189 deletions

File tree

.github/workflows/release.yml

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,61 +15,61 @@ jobs:
1515
- unstable
1616

1717
steps:
18-
- uses: actions/checkout@v2.3.4
19-
with:
20-
ref: 'master'
18+
- uses: actions/checkout@v2.3.4
19+
with:
20+
ref: "master"
2121

22-
- name: Setup node environment for NPMJS
23-
uses: actions/setup-node@v2.4.0
24-
with:
25-
node-version: 14
26-
cache: 'npm'
27-
registry-url: 'https://registry.npmjs.org'
28-
cache-dependency-path: |
29-
stable/package-lock.json
30-
unstable/package-lock.json
22+
- name: Setup node environment for NPMJS
23+
uses: actions/setup-node@v2.4.0
24+
with:
25+
node-version: 14
26+
cache: "npm"
27+
registry-url: "https://registry.npmjs.org"
28+
cache-dependency-path: |
29+
stable/package-lock.json
30+
unstable/package-lock.json
3131
32-
- name: Get package version
33-
id: version
34-
run: echo "::set-output name=number::$(echo $(cat package.json | jq '.version') | tr -d '"')"
35-
working-directory: ./${{ matrix.version }}
32+
- name: Get package version
33+
id: version
34+
run: echo "::set-output name=number::$(echo $(cat package.json | jq '.version') | tr -d '"')"
35+
working-directory: ./${{ matrix.version }}
3636

37-
- name: Install dependencies
38-
run: npm ci --no-audit
39-
working-directory: ./${{ matrix.version }}
37+
- name: Install dependencies
38+
run: npm ci --no-audit
39+
working-directory: ./${{ matrix.version }}
4040

41-
- name: Publish to npm
42-
run: npm publish --tag ${{ matrix.version }} --access public
43-
working-directory: ./${{ matrix.version }}
44-
env:
45-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
- name: Publish to npm
42+
run: npm publish --tag ${{ matrix.version }} --access public
43+
working-directory: ./${{ matrix.version }}
44+
env:
45+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4646

47-
- name: Set as latest in npm
48-
if: ${{ matrix.version == 'stable' }}
49-
run: npm dist-tag add @jellyfin/client-axios@${{ steps.version.outputs.number }} latest
50-
working-directory: ./${{ matrix.version }}
51-
env:
52-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
- name: Set as latest in npm
48+
if: ${{ matrix.version == 'stable' }}
49+
run: npm dist-tag add @jellyfin/client-axios@${{ steps.version.outputs.number }} latest
50+
working-directory: ./${{ matrix.version }}
51+
env:
52+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5353

54-
- name: Setup node environment for GitHub Package Registry
55-
uses: actions/setup-node@v2.4.0
56-
with:
57-
node-version: 14
58-
cache: 'npm'
59-
registry-url: 'https://npm.pkg.github.com'
60-
cache-dependency-path: |
61-
stable/package-lock.json
62-
unstable/package-lock.json
54+
- name: Setup node environment for GitHub Package Registry
55+
uses: actions/setup-node@v2.4.0
56+
with:
57+
node-version: 14
58+
cache: "npm"
59+
registry-url: "https://npm.pkg.github.com"
60+
cache-dependency-path: |
61+
stable/package-lock.json
62+
unstable/package-lock.json
6363
64-
- name: Publish to GitHub Package registry
65-
run: npm publish --tag ${{ matrix.version }} --access public
66-
working-directory: ./${{ matrix.version }}
67-
env:
68-
NODE_AUTH_TOKEN: ${{ secrets.ORG_PAT }}
64+
- name: Publish to GitHub Package registry
65+
run: npm publish --tag ${{ matrix.version }} --access public
66+
working-directory: ./${{ matrix.version }}
67+
env:
68+
NODE_AUTH_TOKEN: ${{ secrets.ORG_PAT }}
6969

70-
- name: Set as latest in GitHub Packages
71-
if: ${{ matrix.version == 'stable' }}
72-
run: npm dist-tag add @jellyfin/client-axios@${{ steps.version.outputs.number }} latest
73-
working-directory: ./${{ matrix.version }}
74-
env:
75-
NODE_AUTH_TOKEN: ${{ secrets.ORG_PAT }}
70+
- name: Set as latest in GitHub Packages
71+
if: ${{ matrix.version == 'stable' }}
72+
run: npm dist-tag add @jellyfin/client-axios@${{ steps.version.outputs.number }} latest
73+
working-directory: ./${{ matrix.version }}
74+
env:
75+
NODE_AUTH_TOKEN: ${{ secrets.ORG_PAT }}

.github/workflows/stable-generation.yml

Lines changed: 61 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,80 +4,77 @@ on:
44
schedule:
55
- cron: "0 0 * * *"
66
workflow_dispatch:
7+
pull_request:
78

89
jobs:
910
build:
1011
runs-on: ubuntu-latest
1112
steps:
12-
- uses: actions/checkout@v2.3.4
13-
with:
14-
ref: 'master'
15-
16-
- name: Download OpenAPI file
17-
run: curl -s https://api.jellyfin.org/openapi/jellyfin-openapi-stable.json > openapi.json
18-
19-
- name: Modify the schema
20-
run: node scripts/modifySchema.mjs openapi.json
13+
- uses: actions/checkout@v2.3.4
2114

22-
- name: Generate
23-
uses: docker://openapitools/openapi-generator-cli:latest-release
24-
env:
25-
TS_POST_PROCESS_FILE: true
26-
with:
27-
args: >-
28-
generate -i /github/workspace/openapi.json
29-
-g typescript-axios --additional-properties=npmName=@jellyfin/client-axios
30-
--additional-properties=npmRepository=https://www.npmjs.com/package/@jellyfin/client-axios
31-
--additional-properties=supportsES6=true
32-
--additional-properties=useSingleRequestParameter=true
33-
--additional-properties=withSeparateModelsAndApi=true
34-
--additional-properties=modelPackage=models
35-
--additional-properties=apiPackage=api
36-
--enable-post-process-file
37-
-o /github/workspace/stable
15+
- name: Download OpenAPI file
16+
run: curl -s https://api.jellyfin.org/openapi/jellyfin-openapi-stable.json > openapi.json
3817

39-
- name: Check if .ts files were modified
40-
id: diff
41-
run: echo "::set-output name=count::$(git status -s | grep ts | wc -l)"
18+
- name: Modify the schema
19+
run: node scripts/modifySchema.mjs openapi.json
4220

43-
- name: Get OpenApi version
44-
if: ${{ steps.diff.outputs.count }} > 0
45-
id: version
46-
run: echo "::set-output name=number::$(cat openapi.json | jq '.info.version')"
21+
- name: Generate
22+
uses: docker://openapitools/openapi-generator-cli:latest-release
23+
env:
24+
TS_POST_PROCESS_FILE: true
25+
with:
26+
args: >-
27+
generate -i /github/workspace/openapi.json
28+
-g typescript-axios --additional-properties=npmName=@jellyfin/client-axios
29+
--additional-properties=npmRepository=https://www.npmjs.com/package/@jellyfin/client-axios
30+
--additional-properties=supportsES6=true
31+
--additional-properties=useSingleRequestParameter=true
32+
--additional-properties=withSeparateModelsAndApi=true
33+
--additional-properties=modelPackage=models
34+
--additional-properties=apiPackage=api
35+
--enable-post-process-file
36+
-o /github/workspace/stable
4737
48-
- name: Set version in package.json
49-
if: ${{ steps.diff.outputs.count }} > 0
50-
run: |
51-
echo "$(cat stable/package.json | jq '.version = ${{ steps.version.outputs.number }}')" > stable/package.json
52-
echo "$(cat stable/package-lock.json | jq '.version = ${{ steps.version.outputs.number }}')" > stable/package-lock.json
38+
- name: Check if .ts files were modified
39+
id: diff
40+
run: echo "::set-output name=count::$(git status -s | grep ts | wc -l)"
5341

54-
- name: Setup node environment
55-
if: ${{ steps.diff.outputs.count }} > 0
56-
uses: actions/setup-node@v2.4.0
57-
with:
58-
node-version: 14
59-
cache: 'npm'
60-
cache-dependency-path: |
61-
stable/package-lock.json
62-
unstable/package-lock.json
42+
- name: Get OpenApi version
43+
if: ${{ steps.diff.outputs.count }} > 0
44+
id: version
45+
run: echo "::set-output name=number::$(cat openapi.json | jq '.info.version')"
6346

64-
- name: Install dependencies
65-
if: ${{ steps.diff.outputs.count }} > 0
66-
run: npm ci --no-audit
67-
working-directory: ./stable
47+
- name: Set version in package.json
48+
if: ${{ steps.diff.outputs.count }} > 0
49+
run: |
50+
echo "$(cat stable/package.json | jq '.version = ${{ steps.version.outputs.number }}')" > stable/package.json
51+
echo "$(cat stable/package-lock.json | jq '.version = ${{ steps.version.outputs.number }}')" > stable/package-lock.json
6852
69-
- name: Build
70-
if: ${{ steps.diff.outputs.count }} > 0
71-
run: npm run build
72-
working-directory: ./stable
53+
- name: Setup node environment
54+
if: ${{ steps.diff.outputs.count }} > 0
55+
uses: actions/setup-node@v2.4.0
56+
with:
57+
node-version: 14
58+
cache: "npm"
59+
cache-dependency-path: stable/package-lock.json
7360

74-
# "echo" in commit returns true so the build succeeds, even if no changed files
75-
- name: Commit new changes to the repo
76-
if: ${{ steps.diff.outputs.count }} > 0
77-
run: |
78-
git config --global user.email "packaging@jellyfin.org"
79-
git config --global user.name "Jellyfin Packaging Team"
80-
git pull
81-
git add .
82-
git commit -m "Update stable OpenAPI client" || echo
83-
git push
61+
- name: Install dependencies
62+
if: ${{ steps.diff.outputs.count }} > 0
63+
run: npm ci --no-audit
64+
working-directory: ./stable
65+
66+
- name: Build
67+
if: ${{ steps.diff.outputs.count }} > 0
68+
run: npm run build
69+
working-directory: ./stable
70+
71+
# "echo" in commit returns true so the build succeeds, even if no changed files
72+
- name: Commit new changes to the repo
73+
if: ${{ steps.diff.outputs.count }} > 0 && github.event_name != 'pull_request'
74+
run: |
75+
git config --global user.email "packaging@jellyfin.org"
76+
git config --global user.name "Jellyfin Packaging Team"
77+
git pull
78+
git add .
79+
git commit -m "Update stable OpenAPI client" || echo
80+
git push

0 commit comments

Comments
 (0)