BUILD #8139
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- name: Setup Python 3.9 | |
uses: actions/setup-python@v5 | |
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/git-auto-commit-action@master | |
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+=("$asset") | |
done | |
assets+=("all_playlists.zip") | |
tag_name=`date '+%Y%m%d%H%M'` | |
gh release create "$tag_name" "${assets[@]}" --latest -t "latest" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cleanup | |
uses: dev-drprasad/delete-older-releases@master | |
with: | |
keep_latest: 1 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |