-
-
Notifications
You must be signed in to change notification settings - Fork 170
70 lines (60 loc) · 1.99 KB
/
main.yml
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
name: Update Chinese EPG File
on:
workflow_dispatch:
schedule:
- cron: '30 * * * *'
push:
branches:
- master
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: set variables
run: |
echo "UPDATE_TIME=$(TZ='Asia/Shanghai' date +%Y-%m-%d\ %H:%M\ %Z)" >> $GITHUB_ENV
- name: set up python 3
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: prepare release
uses: actions/checkout@v2
with:
path: release
ref: master
- name: prepare generater
uses: actions/checkout@v2
with:
repository: BurningC4/getepg
ssh-key: ${{ secrets.GETEPG }}
path: getepg
ref: main
- name: get new epg file
run: |
sudo pip3 install -r getepg/requirements.txt
sudo python3 getepg/getepg.py --file release/guide.xml
- name: Upload epgfile to R2
uses: magicwallet/r2-upload@main
with:
endpoint: ${{ secrets.R2_ENDPOINT }}
access_key_id: ${{ secrets.R2_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.R2_ACCESS_SECRET_KEY }}
bucket: ${{ secrets.R2_BUCKET }}
file: release/guide.xml
destination: 'guide.xml'
- name: Upload playlist to R2
uses: magicwallet/r2-upload@main
with:
endpoint: ${{ secrets.R2_ENDPOINT }}
access_key_id: ${{ secrets.R2_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.R2_ACCESS_SECRET_KEY }}
bucket: ${{ secrets.R2_BUCKET }}
file: release/TV-IPV4.m3u
destination: 'TV-IPV4.m3u'
- name: push release
run: |
git -C release config --local user.name github-actions
git -C release config --local user.email [email protected]
git -C release add guide.xml
git -C release commit -m "auto update at ${{ env.UPDATE_TIME }}" --allow-empty
git -C release push