All checks were successful
Generate M3U Playlist / build (push) Successful in 1m38s
82 lines
No EOL
2.6 KiB
YAML
82 lines
No EOL
2.6 KiB
YAML
name: Generate M3U Playlist
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.9'
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config --local user.email "actions@forgejo.plainrock127.xyz"
|
|
git config --local user.name "Gitea Actions Bot"
|
|
|
|
- name: Set file permissions and debug
|
|
run: |
|
|
echo "=== Current user and permissions ==="
|
|
whoami
|
|
pwd
|
|
ls -la
|
|
echo "=== Setting file permissions ==="
|
|
chmod 664 channels.txt || echo "Could not chmod channels.txt"
|
|
chmod 664 bulk_import.m3u || echo "Could not chmod bulk_import.m3u (might not exist)"
|
|
chmod 775 . || echo "Could not chmod directory"
|
|
echo "=== Files before processing ==="
|
|
echo "channels.txt line count:"
|
|
wc -l channels.txt || echo "channels.txt not found"
|
|
echo "bulk_import.m3u exists:"
|
|
ls -la bulk_import.m3u || echo "bulk_import.m3u not found"
|
|
|
|
- name: Generate M3U
|
|
run: python generate_playlist.py
|
|
|
|
- name: Debug after processing
|
|
run: |
|
|
echo "=== Files after processing ==="
|
|
ls -la
|
|
echo "=== channels.txt line count after ==="
|
|
wc -l channels.txt || echo "channels.txt not found"
|
|
echo "=== bulk_import.m3u still exists? ==="
|
|
ls -la bulk_import.m3u || echo "bulk_import.m3u not found (good!)"
|
|
echo "=== Log content ==="
|
|
cat playlist_update.log || echo "No log file"
|
|
echo "=== playlist.m3u line count ==="
|
|
wc -l playlist.m3u || echo "playlist.m3u not found"
|
|
|
|
- name: Prepare for Pages
|
|
run: |
|
|
mkdir -p docs
|
|
cp playlist.m3u docs/playlist.m3u
|
|
cp playlist_update.log docs/playlist_update.log || true
|
|
|
|
- name: Commit and Push
|
|
run: |
|
|
git add channels.txt || echo "No channels.txt to add"
|
|
git add playlist.m3u || echo "No playlist.m3u to add"
|
|
git add playlist_update.log || echo "No playlist_update.log to add"
|
|
git add docs/playlist.m3u || echo "No docs/playlist.m3u to add"
|
|
git add docs/playlist_update.log || echo "No docs/playlist_update.log to add"
|
|
|
|
echo "=== Git status ==="
|
|
git status
|
|
|
|
if git diff --staged --quiet; then
|
|
echo "No changes to commit"
|
|
else
|
|
git commit -m "Update M3U playlist via Gitea Actions - $(date)"
|
|
git push
|
|
fi
|
|
env:
|
|
GITEA_TOKEN |