-
Notifications
You must be signed in to change notification settings - Fork 4
72 lines (71 loc) · 2.62 KB
/
update.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: EPG Update
run-name: Updating the EPG 🎐
on:
workflow_dispatch:
schedule:
# At minute 0
- cron: "0 * * * *"
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Downloading the channels database
uses: actions/checkout@v4
with:
repository: "Animenosekai/database"
# Relative path under $GITHUB_WORKSPACE to place the repository
path: "database"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Installing Python dependencies
run: python -m pip install -r requirements.txt
- name: Getting the channels ID
run: python scripts/filter.py --input database/data/channels.csv --language="jpn" --country="JP" --minify channels.json
- name: Downloading the EPG fetchers
uses: actions/checkout@v4
with:
repository: "Animenosekai/epg"
# Relative path under $GITHUB_WORKSPACE to place the repository
path: "epg"
- name: Filtering the channels
run: python scripts/fetcher.py --input channels.json --sites epg/sites japanterebi.channels.xml
- uses: actions/setup-node@v4
with:
# node-version: latest
# We can't use `latest` for now as the build for `libxmljs2` seems to fail
node-version: "21.7.3"
# `package-lock.json` is not here yet
# cache: npm
- name: Installing JavaScript dependencies
run: |
cd epg
npm install
- name: Fetching the programs data
run: |
cd epg
npm run grab -- --channels=../japanterebi.channels.xml --maxConnections=10 --output="../guide.xml"
- name: Fixing the document
run: python scripts/fix.py --input guide.xml guide.xml
- name: Merging redundant programs
run: python scripts/merger.py --input guide.xml guide.xml
- name: Minify XML
run: python scripts/minify.py --input guide.xml guide.xml
- name: Remove the downloaded repositories
run: |
echo "Removing 'database'"
rm -r database
echo "Removing 'epg'"
rm -r epg
- name: Committing the new data
run: |
git config --global user.name 'Japan Terebi [GitHub Actions]'
git config --global user.email '[email protected]'
export NOW=$(date +'%Y-%m-%dT%H:%M:%S')
git add guide.xml
git add channels.json
git add japanterebi.channels.xml
git commit -am "Automated guide.xml update ($NOW)"
git push