BUILD #7834
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@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 }} |