1
0
mirror of https://github.com/darkzoul5/YoutubePlaylistSync.git synced 2026-07-03 04:23:59 +03:00

Refactor CI/CD workflow to use GitHub Actions and update README for clarity

This commit is contained in:
2026-03-07 14:07:50 +02:00
parent b2c64072c8
commit c04a216a58
2 changed files with 66 additions and 36 deletions
+59 -29
View File
@@ -1,11 +1,9 @@
name: Build Release Packages
on:
push:
#branches:
#- test
tags:
- "v*.*.*"
#push:
#tags:
#- "v*.*.*"
workflow_dispatch:
jobs:
@@ -13,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: https://gitea.com/actions/checkout@v5
uses: actions/checkout@v5
- name: Install dependencies
run: |
@@ -22,14 +20,14 @@ jobs:
- name: Extract tag name
run: |
REF="${GITEA_REF:-$GITHUB_REF}"
REF="${GITHUB_REF}"
TAG="${REF#refs/tags/}"
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Prepare Windows package
run: |
set -e
WORKSPACE_ROOT="${GITEA_WORKSPACE:-$PWD}"
WORKSPACE_ROOT="${GITHUB_WORKSPACE:-$PWD}"
mkdir -p "$WORKSPACE_ROOT/dist/windows"
cp "$WORKSPACE_ROOT/yt-playlist-main.py" "$WORKSPACE_ROOT/dist/windows/"
@@ -57,7 +55,7 @@ jobs:
echo "ZIP_PATH=$WORKSPACE_ROOT/$ZIP_NAME" >> $GITHUB_ENV
- name: Upload Windows artifact
uses: christopherhx/gitea-upload-artifact@v4
uses: actions/upload-artifact@v4
with:
name: windows-zip
path: ${{ env.ZIP_PATH }}
@@ -74,7 +72,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: https://gitea.com/actions/checkout@v5
uses: actions/checkout@v5
- name: Install dependencies
run: |
@@ -85,14 +83,14 @@ jobs:
- name: Extract tag name
run: |
REF="${GITEA_REF:-$GITHUB_REF}"
REF="${GITHUB_REF}"
TAG="${REF#refs/tags/}"
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Prepare Linux package
run: |
set -e
WORKSPACE_ROOT="${GITEA_WORKSPACE:-$PWD}"
WORKSPACE_ROOT="${GITHUB_WORKSPACE:-$PWD}"
mkdir -p "$WORKSPACE_ROOT/dist/linux"
cp "$WORKSPACE_ROOT/yt-playlist-main.py" "$WORKSPACE_ROOT/dist/linux/"
@@ -138,7 +136,7 @@ jobs:
echo "ZIP_PATH=$WORKSPACE_ROOT/$ZIP_NAME" >> $GITHUB_ENV
- name: Upload Linux artifact
uses: christopherhx/gitea-upload-artifact@v4
uses: actions/upload-artifact@v4
with:
name: linux-zip
path: ${{ env.ZIP_PATH }}
@@ -152,17 +150,17 @@ jobs:
IMAGE_NAME: youtube-playlist-downloader
steps:
- name: Checkout code
uses: https://gitea.com/actions/checkout@v5
uses: actions/checkout@v5
- name: Extract tag name
run: |
set -e
REF="${GITEA_REF:-$GITHUB_REF}"
set -e
REF="${GITHUB_REF}"
TAG="${REF#refs/tags/}"
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Download linux-zip artifact
uses: christopherhx/gitea-download-artifact@v4
uses: actions/download-artifact@v4
with:
name: linux-zip
@@ -179,7 +177,7 @@ jobs:
docker save -o docker-image.tar ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
- name: Upload docker-image-${TAG} artifact
uses: christopherhx/gitea-upload-artifact@v4
uses: actions/upload-artifact@v4
with:
name: docker-image
path: docker-image.tar
@@ -192,7 +190,7 @@ jobs:
docker save -o docker-image-latest.tar ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}:latest
- name: Upload docker-image-latest artifact
uses: christopherhx/gitea-upload-artifact@v4
uses: actions/upload-artifact@v4
with:
name: docker-image-latest
path: docker-image-latest.tar
@@ -207,16 +205,16 @@ jobs:
IMAGE_NAME: youtube-playlist-downloader
steps:
- name: Download all artifacts
uses: christopherhx/gitea-download-artifact@v4
uses: actions/download-artifact@v4
- name: Extract tag name
run: |
REF="${GITEA_REF:-$GITHUB_REF}"
REF="${GITHUB_REF}"
TAG="${REF#refs/tags/}"
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Login to the Container registry
uses: https://gitea.com/docker/login-action@v3
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_URL }}
username: ${{ env.REGISTRY_OWNER }}
@@ -238,12 +236,44 @@ jobs:
- name: Push Docker image as latest
run: docker push ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}:latest
- name: Publish release
uses: https://gitea.com/actions/gitea-release-action@v1
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
tag_name: ${{ env.TAG }}
name: ${{ env.TAG }}
files: |
linux-zip/*
windows-zip/*
release_name: ${{ env.TAG }}
draft: true
- name: Upload Windows release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: windows-zip/yt-playlist-windows-${{ env.TAG }}.zip
asset_name: yt-playlist-windows-${{ env.TAG }}.zip
asset_content_type: application/zip
- name: Upload Linux release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: linux-zip/yt-playlist-linux-${{ env.TAG }}.tar.gz
asset_name: yt-playlist-linux-${{ env.TAG }}.tar.gz
asset_content_type: application/gzip
- name: Upload Docker image (release tag)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: docker-image/docker-image.tar
asset_name: docker-image-${{ env.TAG }}.tar
asset_content_type: application/x-tar
- name: Upload Docker image (latest)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: docker-image-latest/docker-image-latest.tar
asset_name: docker-image-latest.tar
asset_content_type: application/x-tar
+7 -7
View File
@@ -1,6 +1,6 @@
# YouTube Playlist Downloader
A cross-platform tool for downloading entire YouTube playlists as MP3 or MP4 files, using [yt-dlp](https://github.com/yt-dlp/yt-dlp), [ffmpeg](https://ffmpeg.org/), and [aria2c](https://github.com/aria2/aria2). Includes Gitea CI/CD workflow for packaging and releasing Windows and Linux binaries.
A cross-platform tool for downloading entire YouTube playlists as MP3 or MP4 files, using [yt-dlp](https://github.com/yt-dlp/yt-dlp), [ffmpeg](https://ffmpeg.org/), and [aria2c](https://github.com/aria2/aria2). Includes a GitHub Actions CI/CD workflow for packaging and releasing Windows and Linux binaries.
Supports audio, video, or both download modes, music and videos are numbered as they are on your youtube playlist, playlist cleanup, and configurable parallel download options.
@@ -16,7 +16,7 @@ Supports audio, video, or both download modes, music and videos are numbered as
- **Cleanup of tracks:** Option to remove files not in playlist anymore, with confirmation.
- **Configurable output paths** and archive tracking.
- **Cross-platform:** Windows and Linux support.
- **Gitea CI/CD workflow** for automated packaging and release.
- **GitHub Actions CI/CD workflow** for automated packaging and release.
---
@@ -32,7 +32,7 @@ Supports audio, video, or both download modes, music and videos are numbered as
1. **Download the latest release:**
- Go to the [Releases](https://git.darkzoul.org/dark_zoul/YouTube-Playlist-Downloader/releases) page.
- Go to the [Releases](https://github.com/darkzoul5/YoutubePlaylistDownloader/releases) page.
- Download the appropriate archive for your platform (Windows or Linux).
1. **Unzip the archive:**
@@ -108,7 +108,7 @@ Edit `yt-playlist-config.json` to specify playlists, paths, and options:
- Offer to clean up files that are no longer in the playlist
---
## Docker Usage
You can run YouTube Playlist Downloader using the official Docker image.
@@ -116,7 +116,7 @@ You can run YouTube Playlist Downloader using the official Docker image.
### Run the container
```pwsh
docker run -v /path/to/downloads:/app/downloads -v /path/to/config:/app/config git.darkzoul.org/dark_zoul/youtube-playlist-downloader:latest
docker run -v /path/to/downloads:/app/downloads -v /path/to/config:/app/config ghcr.io/dark_zoul/YoutubePlaylistDownloader:latest
```
Replace `/path/to/downloads` and `/path/to/config` with your local directories.
@@ -133,7 +133,7 @@ Create a `docker-compose.yml` with the following content (replace the host paths
```yaml
services:
yt-downloader:
image: git.darkzoul.org/dark_zoul/youtube-playlist-downloader:latest
image: ghcr.io/dark_zoul/YoutubePlaylistDownloader:latest
container_name: yt-downloader
restart: no
volumes:
@@ -166,4 +166,4 @@ See [LICENSE](LICENSE).
- [yt-dlp](https://github.com/yt-dlp/yt-dlp)
- [ffmpeg](https://ffmpeg.org/)
- [aria2c](https://github.com/aria2/aria2)
- [aria2c](https://github.com/aria2/aria2)