Skip to content

Commit

Permalink
Merge pull request #4 from jellyfin/rework-directory-and-add-ci
Browse files Browse the repository at this point in the history
Rework directory structure and add CI/CD
  • Loading branch information
heyhippari authored Apr 9, 2021
2 parents e8f7713 + 3d62bde commit c96d690
Show file tree
Hide file tree
Showing 13 changed files with 165 additions and 107 deletions.
143 changes: 76 additions & 67 deletions .github/studios.schema.json
Original file line number Diff line number Diff line change
@@ -1,72 +1,81 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Jellyfin studio artwork",
"description": "A set of artwork for studios, used by Jellyfin",
"type": "array",
"items": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Jellyfin studio artwork",
"description": "A set of artwork for studios, used by Jellyfin",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Standard name of the studio, network or label in English",
"type": "string"
},
"providers": {
"type": "object",
"description": "Identifiers for various metadata providers",
"properties": {
"name": {
"description": "Standard name of the studio, network or label in English",
"type": "string"
},
"providers": {
"type": "object",
"description": "Identifiers for various metadata providers",
"properties": {
"tvdb": {
"description": "Identifier of the network on TVDB",
"type": "string"
},
"tmdb": {
"description": "Identifier of the network or studio on TheMovieDB",
"type": "string"
},
"imdb": {
"description": "Identifier of the company on IMDB",
"type": "string"
},
"musicbrainz": {
"description": "Identifier of the label on MusicBrainz",
"type": "string"
},
"anidb": {
"description": "Identifier of the studio on AniDB",
"type": "string"
},
"anilist": {
"description": "Identifier of the studio on AniList",
"type": "string"
},
"additionalProperties": true
}
},
"artwork": {
"type": "object",
"properties": {
"primary": {
"type": "string"
},
"thumb": {
"type": "string"
},
"logo": {
"type": "string"
},
"backdrop": {
"type": "string"
}
},
"required": [
"primary",
"thumb"
]
"tvdb": {
"description": "Identifier of the network on TVDB",
"type": "string"
},
"tmdb": {
"description": "Identifier of the network or studio on TheMovieDB",
"type": "string"
},
"imdb": {
"description": "Identifier of the company on IMDB",
"type": "string"
},
"musicbrainz": {
"description": "Identifier of the label on MusicBrainz",
"type": "string"
},
"anidb": {
"description": "Identifier of the studio on AniDB",
"type": "string"
},
"anilist": {
"description": "Identifier of the studio on AniList",
"type": "string"
},
"additionalProperties": true
}
},
"artwork": {
"type": "object",
"properties": {
"primary": {
"type": "array",
"items": {
"type": "string",
"enum": ["webp", "svg"]
}
},
"thumb": {
"type": "array",
"items": {
"type": "string",
"enum": ["webp", "svg"]
}
},
"logo": {
"type": "array",
"items": {
"type": "string",
"enum": ["webp", "svg"]
}
},
"backdrop": {
"type": "array",
"items": {
"type": "string",
"enum": ["webp", "svg"]
}
}
},
"required": [
"name",
"providers",
"artwork"
]
}
}
"required": ["primary", "thumb"]
}
},
"required": ["name", "providers", "artwork"]
}
}
42 changes: 42 additions & 0 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build & release

on:
push:
branches:
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- name: Install build dependencies
run: npm install svgo
- name: Create dist directory
run: mkdir dist
- name: Copy source SVGs
run: cp -r studios dist/
- name: Optimize source SVGs
run: npx svgo --multipass dist/studios/**/*.svg
- name: ImageMagick Action
uses: jruipinto/ImageMagick-action@v1
with:
# ImageMagick command to be executed
command: mogrify -format webp dist/studios/**/*.svg
- name: Build studios.json
run: jq -s '.[0]=([.[]]|flatten)|.[0]' studios/**/studio.json > dist/studios.json
- name: Remove individual JSON files
run: rm dist/studios/**/studio.json
- name: Compress built assets
run: cd dist; zip -r -D ../release.zip *; cd ..
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GH_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
files: |
release.zip
4 changes: 2 additions & 2 deletions .github/workflows/validate_json.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate studios JSON file
name: Validate JSON files

on:
pull_request:
Expand All @@ -16,4 +16,4 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
json_schema: .github/studios.schema.json
json_path_pattern: studios.json
json_path_pattern: studios/.*/studio.json$
38 changes: 0 additions & 38 deletions studios.json

This file was deleted.

File renamed without changes
15 changes: 15 additions & 0 deletions studios/e/studio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"name": "E!",
"machine-name": "e",
"providers": {
"tvdb": "87",
"tmdb": "76",
"imdb": "co0022548"
},
"artwork": {
"primary": ["svg", "webp"],
"thumb": ["svg", "webp"]
}
}
]
File renamed without changes
File renamed without changes
14 changes: 14 additions & 0 deletions studios/game-show-network/studio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"name": "Game Show Network",
"machine-name": "game-show-network",
"providers": {
"tvdb": "116",
"tmdb": "63"
},
"artwork": {
"primary": ["svg", "webp"],
"thumb": ["svg", "webp"]
}
}
]
File renamed without changes
File renamed without changes
16 changes: 16 additions & 0 deletions studios/netflix/studio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"name": "Netflix",
"machine-name": "netflix",
"providers": {
"tvdb": "535",
"tmdb": "213",
"imdb": "co0144901",
"anidb": "54015"
},
"artwork": {
"primary": ["svg", "webp"],
"thumb": ["svg", "webp"]
}
}
]
File renamed without changes

0 comments on commit c96d690

Please sign in to comment.