-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.5 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
name: BUILD
# Controls when the workflow will run
on:
schedule:
- cron: "0 18 * * *"
push:
branches: [ main ]
workflow_dispatch:
branches: [ main ]
jobs:
build:
name: Build playlist
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Generate version file
run: |
echo `date +%Y%m%d%H%M%S` > version.txt
- name: Auto Commit
uses: stefanzweifel/[email protected]
with:
commit_message: Auto Commit
- name: Generate Playlist
run: |
mkdir out
python main.py
- name: Release
run: |
set -x
cd out
zip -r all_playlists.zip ./*.*
assets=()
for asset in ./*.bplist; do
assets+=("-a" "$asset")
done
assets+=("-a" "all_playlists.zip")
tag_name=`date '+%Y%m%d%H%M'`
hub release create "${assets[@]}" -m "Latest" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup
uses: dev-drprasad/[email protected]
with:
keep_latest: 1
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}