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

Merge pull request 'Next' (#1) from Next into main

Reviewed-on: dark_zoul/youtube-playlist-downloader#1
This commit is contained in:
2025-10-17 15:54:03 +03:00
3 changed files with 92 additions and 20 deletions
+3 -3
View File
@@ -3,9 +3,9 @@ name: Build Docker Image
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
#push:
#tags:
#- "v*.*.*"
jobs:
build:
+85 -6
View File
@@ -8,7 +8,7 @@ on:
- "v*.*.*"
jobs:
windows-package:
build-windows-package:
runs-on: ubuntu-latest
steps:
- name: Checkout code
@@ -69,7 +69,7 @@ jobs:
linux-package:
build-linux-package:
runs-on: ubuntu-latest
steps:
- name: Checkout code
@@ -130,10 +130,10 @@ jobs:
# Cleanup
rm -rf "$WORKSPACE_ROOT/dist/linux/ffmpeg_temp" "$WORKSPACE_ROOT/dist/linux/aria2c_build" "$WORKSPACE_ROOT/dist/linux/ffmpeg.tar.xz" "$WORKSPACE_ROOT/aria2-1.37.0" "$WORKSPACE_ROOT/aria2-1.37.0.tar.gz"
# Zip everything
# GZip everything
cd "$WORKSPACE_ROOT/dist/linux"
ZIP_NAME="yt-playlist-linux-${TAG}.zip"
zip -r "$WORKSPACE_ROOT/$ZIP_NAME" *
ZIP_NAME="yt-playlist-linux-${TAG}.tar.gz"
tar -czf "$WORKSPACE_ROOT/$ZIP_NAME" *
echo "ZIP_PATH=$WORKSPACE_ROOT/$ZIP_NAME" >> $GITHUB_ENV
- name: Upload Linux artifact
@@ -142,12 +142,68 @@ jobs:
name: linux-zip
path: ${{ env.ZIP_PATH }}
build-docker-image:
runs-on: ubuntu-latest
needs: [build-linux-package]
env:
REGISTRY_URL: git.darkzoul.org
REGISTRY_OWNER: dark_zoul
IMAGE_NAME: youtube-playlist-downloader
steps:
- name: Checkout code
uses: https://gitea.com/actions/checkout@v5
- name: Extract tag name
run: |
set -e
REF="${GITEA_REF:-$GITHUB_REF}"
TAG="${REF#refs/tags/}"
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Download linux-zip artifact
uses: christopherhx/gitea-download-artifact@v4
with:
name: linux-zip
- name: Extract linux-zip artifact
run: |
set -e
tar -xzf yt-playlist-linux-${TAG}.tar.gz
- name: Build Docker image with release tag
run: docker build ./ -t ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
- name: Save Docker image ${TAG} as tar
run: |
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
with:
name: docker-image
path: docker-image.tar
- name: Build Docker image as latest (distinct digest)
run: docker build ./ --label build_as_latest=true -t ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}:latest
- name: Save Docker image as tar
run: |
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
with:
name: docker-image-latest
path: docker-image-latest.tar
release:
runs-on: ubuntu-latest
needs: [windows-package, linux-package]
needs: [build-windows-package, build-linux-package, build-docker-image]
env:
REGISTRY_URL: git.darkzoul.org
REGISTRY_OWNER: dark_zoul
IMAGE_NAME: youtube-playlist-downloader
steps:
- name: Download all artifacts
uses: christopherhx/gitea-download-artifact@v4
@@ -158,6 +214,29 @@ jobs:
TAG="${REF#refs/tags/}"
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Login to the Container registry
uses: https://gitea.com/docker/login-action@v3
with:
registry: ${{ env.REGISTRY_URL }}
username: ${{ env.REGISTRY_OWNER }}
password: ${{ secrets.MY_REGISTRY_ACCESS_TOKEN }}
- name: Load docker image from tar
run: |
set -e
docker load -i docker-image/docker-image.tar
- name: Push Docker image with release tag
run: docker push ${{ env.REGISTRY_URL }}/${{ env.REGISTRY_OWNER }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
- name: Load docker image from tar
run: |
set -e
docker load -i docker-image-latest/docker-image-latest.tar
- 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
with:
+4 -11
View File
@@ -1,17 +1,10 @@
FROM python:3.12-slim
FROM python:3.12-alpine
WORKDIR /app
# Install runtime dependencies: aria2, ffmpeg, yt-dlp
# Use --no-install-recommends to keep image small and clean up apt lists
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
aria2 \
ffmpeg \
yt-dlp \
&& rm -rf /var/lib/apt/lists/*
COPY yt-playlist-main.py /app/
COPY ./bin/ffmpeg /app/bin
COPY ./bin/yt-dlp /app/bin
COPY ./bin/aria2c /app/bin
CMD ["python", "yt-playlist-main.py"]