Add CI/CD

This commit is contained in:
MrTimscampi 2021-03-13 02:11:57 +01:00
parent 6a8ce2655d
commit a9b6e0218a
6 changed files with 88 additions and 39 deletions

42
.github/workflows/build_and_release.yml vendored Normal file
View File

@ -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.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
files: |
release.zip

View File

@ -1,4 +1,4 @@
name: Validate studios JSON file
name: Validate JSON files
on:
pull_request:

View File

@ -1,38 +0,0 @@
[
{
"name": "E!",
"providers": {
"tvdb": "87",
"tmdb": "76",
"imdb": "co0022548"
},
"artwork": {
"primary": "e",
"thumb": "e"
}
},
{
"name": "Game Show Network",
"providers": {
"tvdb": "116",
"tmdb": "63"
},
"artwork": {
"primary": "game-show-network",
"thumb": "game-show-network"
}
},
{
"name": "Netflix",
"providers": {
"tvdb": "535",
"tmdb": "213",
"imdb": "co0144901",
"anidb": "54015"
},
"artwork": {
"primary": "netflix",
"thumb": "netflix"
}
}
]

15
studios/e/studio.json Normal file
View File

@ -0,0 +1,15 @@
[
{
"name": "E!",
"machine-name": "e",
"providers": {
"tvdb": "87",
"tmdb": "76",
"imdb": "co0022548"
},
"artwork": {
"primary": ["svg", "webp"],
"thumb": ["svg", "webp"]
}
}
]

View File

@ -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"]
}
}
]

View File

@ -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"]
}
}
]