2025-06-28 06:42:45 +02:00
|
|
|
name: Generate M3U Playlist with Auto-Organization
|
2025-06-27 16:30:39 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
2025-06-28 06:42:45 +02:00
|
|
|
build-and-organize:
|
2025-06-28 05:42:03 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2025-06-27 16:30:39 +02:00
|
|
|
steps:
|
2025-06-28 06:42:45 +02:00
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Configure Git
|
|
|
|
run: |
|
|
|
|
git config --local user.email "actions@forgejo.plainrock127.xyz"
|
|
|
|
git config --local user.name "IPTV Playlist Bot"
|
|
|
|
|
2025-06-28 07:23:23 +02:00
|
|
|
- name: Basic Setup
|
2025-06-28 06:42:45 +02:00
|
|
|
run: |
|
2025-06-28 07:23:23 +02:00
|
|
|
# This step previously contained explicit cleanup and Python setup.
|
|
|
|
# These are now handled by the environment or within generate_playlist.py if needed.
|
|
|
|
echo "Basic setup complete."
|
2025-06-28 06:42:45 +02:00
|
|
|
|
|
|
|
- name: Run Playlist Generation
|
|
|
|
run: |
|
|
|
|
echo "Running playlist generation..."
|
2025-06-28 07:23:23 +02:00
|
|
|
python scripts/generate_playlist.py
|
2025-06-28 06:42:45 +02:00
|
|
|
|
2025-06-28 07:23:23 +02:00
|
|
|
- name: Commit and Push if Changes
|
2025-06-28 06:42:45 +02:00
|
|
|
run: |
|
|
|
|
git add .
|
2025-06-28 07:23:23 +02:00
|
|
|
if ! git diff-index --quiet HEAD; then
|
|
|
|
echo "Changes detected, committing..."
|
|
|
|
# Get channel count for commit message
|
|
|
|
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
|
|
|
|
git commit -m "📺 Updated playlist with $CHANNELS channels - $(date '+%Y-%m-%d %H:%M')"
|
2025-06-28 06:42:45 +02:00
|
|
|
git push
|
2025-06-28 07:23:23 +02:00
|
|
|
echo "Changes committed"
|
2025-06-28 06:42:45 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Summary
|
|
|
|
run: |
|
2025-06-28 07:23:23 +02:00
|
|
|
# Get channel count for summary
|
|
|
|
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
|
|
|
|
echo "=== WORKFLOW COMPLETE ==="
|
|
|
|
echo "✅ Playlist has $CHANNELS channels"
|