1
0
mirror of https://github.com/darkzoul5/YoutubePlaylistSync.git synced 2026-07-04 04:53:58 +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 name: Build Release Packages
on: on:
push: #push:
#branches: #tags:
#- test #- "v*.*.*"
tags:
- "v*.*.*"
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -13,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: https://gitea.com/actions/checkout@v5 uses: actions/checkout@v5
- name: Install dependencies - name: Install dependencies
run: | run: |
@@ -22,14 +20,14 @@ jobs:
- name: Extract tag name - name: Extract tag name
run: | run: |
REF="${GITEA_REF:-$GITHUB_REF}" REF="${GITHUB_REF}"
TAG="${REF#refs/tags/}" TAG="${REF#refs/tags/}"
echo "TAG=$TAG" >> $GITHUB_ENV echo "TAG=$TAG" >> $GITHUB_ENV
- name: Prepare Windows package - name: Prepare Windows package
run: | run: |
set -e set -e
WORKSPACE_ROOT="${GITEA_WORKSPACE:-$PWD}" WORKSPACE_ROOT="${GITHUB_WORKSPACE:-$PWD}"
mkdir -p "$WORKSPACE_ROOT/dist/windows" mkdir -p "$WORKSPACE_ROOT/dist/windows"
cp "$WORKSPACE_ROOT/yt-playlist-main.py" "$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 echo "ZIP_PATH=$WORKSPACE_ROOT/$ZIP_NAME" >> $GITHUB_ENV
- name: Upload Windows artifact - name: Upload Windows artifact
uses: christopherhx/gitea-upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: windows-zip name: windows-zip
path: ${{ env.ZIP_PATH }} path: ${{ env.ZIP_PATH }}
@@ -74,7 +72,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: https://gitea.com/actions/checkout@v5 uses: actions/checkout@v5
- name: Install dependencies - name: Install dependencies
run: | run: |
@@ -85,14 +83,14 @@ jobs:
- name: Extract tag name - name: Extract tag name
run: | run: |
REF="${GITEA_REF:-$GITHUB_REF}" REF="${GITHUB_REF}"
TAG="${REF#refs/tags/}" TAG="${REF#refs/tags/}"
echo "TAG=$TAG" >> $GITHUB_ENV echo "TAG=$TAG" >> $GITHUB_ENV
- name: Prepare Linux package - name: Prepare Linux package
run: | run: |
set -e set -e
WORKSPACE_ROOT="${GITEA_WORKSPACE:-$PWD}" WORKSPACE_ROOT="${GITHUB_WORKSPACE:-$PWD}"
mkdir -p "$WORKSPACE_ROOT/dist/linux" mkdir -p "$WORKSPACE_ROOT/dist/linux"
cp "$WORKSPACE_ROOT/yt-playlist-main.py" "$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 echo "ZIP_PATH=$WORKSPACE_ROOT/$ZIP_NAME" >> $GITHUB_ENV
- name: Upload Linux artifact - name: Upload Linux artifact
uses: christopherhx/gitea-upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: linux-zip name: linux-zip
path: ${{ env.ZIP_PATH }} path: ${{ env.ZIP_PATH }}
@@ -152,17 +150,17 @@ jobs:
IMAGE_NAME: youtube-playlist-downloader IMAGE_NAME: youtube-playlist-downloader
steps: steps:
- name: Checkout code - name: Checkout code
uses: https://gitea.com/actions/checkout@v5 uses: actions/checkout@v5
- name: Extract tag name - name: Extract tag name
run: | run: |
set -e set -e
REF="${GITEA_REF:-$GITHUB_REF}" REF="${GITHUB_REF}"
TAG="${REF#refs/tags/}" TAG="${REF#refs/tags/}"
echo "TAG=$TAG" >> $GITHUB_ENV echo "TAG=$TAG" >> $GITHUB_ENV
- name: Download linux-zip artifact - name: Download linux-zip artifact
uses: christopherhx/gitea-download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: linux-zip 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 }} docker save -o docker-image.tar ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
- name: Upload docker-image-${TAG} artifact - name: Upload docker-image-${TAG} artifact
uses: christopherhx/gitea-upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: docker-image name: docker-image
path: docker-image.tar 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 docker save -o docker-image-latest.tar ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}:latest
- name: Upload docker-image-latest artifact - name: Upload docker-image-latest artifact
uses: christopherhx/gitea-upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: docker-image-latest name: docker-image-latest
path: docker-image-latest.tar path: docker-image-latest.tar
@@ -207,16 +205,16 @@ jobs:
IMAGE_NAME: youtube-playlist-downloader IMAGE_NAME: youtube-playlist-downloader
steps: steps:
- name: Download all artifacts - name: Download all artifacts
uses: christopherhx/gitea-download-artifact@v4 uses: actions/download-artifact@v4
- name: Extract tag name - name: Extract tag name
run: | run: |
REF="${GITEA_REF:-$GITHUB_REF}" REF="${GITHUB_REF}"
TAG="${REF#refs/tags/}" TAG="${REF#refs/tags/}"
echo "TAG=$TAG" >> $GITHUB_ENV echo "TAG=$TAG" >> $GITHUB_ENV
- name: Login to the Container registry - name: Login to the Container registry
uses: https://gitea.com/docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ${{ env.REGISTRY_URL }} registry: ${{ env.REGISTRY_URL }}
username: ${{ env.REGISTRY_OWNER }} username: ${{ env.REGISTRY_OWNER }}
@@ -238,12 +236,44 @@ jobs:
- name: Push Docker image as latest - name: Push Docker image as latest
run: docker push ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}:latest run: docker push ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}:latest
- name: Publish release - name: Create GitHub Release
uses: https://gitea.com/actions/gitea-release-action@v1 id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
draft: true
tag_name: ${{ env.TAG }} tag_name: ${{ env.TAG }}
name: ${{ env.TAG }} release_name: ${{ env.TAG }}
files: | draft: true
linux-zip/*
windows-zip/* - 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 # 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. 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. - **Cleanup of tracks:** Option to remove files not in playlist anymore, with confirmation.
- **Configurable output paths** and archive tracking. - **Configurable output paths** and archive tracking.
- **Cross-platform:** Windows and Linux support. - **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:** 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). - Download the appropriate archive for your platform (Windows or Linux).
1. **Unzip the archive:** 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 - Offer to clean up files that are no longer in the playlist
--- ---
## Docker Usage ## Docker Usage
You can run YouTube Playlist Downloader using the official Docker image. 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 ### Run the container
```pwsh ```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. 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 ```yaml
services: services:
yt-downloader: yt-downloader:
image: git.darkzoul.org/dark_zoul/youtube-playlist-downloader:latest image: ghcr.io/dark_zoul/YoutubePlaylistDownloader:latest
container_name: yt-downloader container_name: yt-downloader
restart: no restart: no
volumes: volumes:
@@ -166,4 +166,4 @@ See [LICENSE](LICENSE).
- [yt-dlp](https://github.com/yt-dlp/yt-dlp) - [yt-dlp](https://github.com/yt-dlp/yt-dlp)
- [ffmpeg](https://ffmpeg.org/) - [ffmpeg](https://ffmpeg.org/)
- [aria2c](https://github.com/aria2/aria2) - [aria2c](https://github.com/aria2/aria2)