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

Refactor release workflow to separate Windows and Linux package jobs, enhance dependency installation, and streamline upload steps

This commit is contained in:
2025-10-13 00:07:04 +03:00
parent 444fc53911
commit 83c389bf82
+30 -26
View File
@@ -2,30 +2,24 @@ name: Build Release Packages
on: on:
push: push:
tags: #tags:
- "v*" #- "v*"
jobs: jobs:
package: windows-package:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: https://gitea.com/actions/checkout@v5 uses: https://gitea.com/actions/checkout@v5
- name: Set up Python - name: Set up Python
uses: https://gitea.com/actions/setup-python@v6 uses: https://gitea.com/actions/setup-python@v6
with: with:
python-version: "3.12" python-version: "3.12"
- name: Install dependencies - name: Install dependencies
run: | run: |
pip install --upgrade pip pip install --upgrade pip
sudo apt-get update sudo apt update
sudo apt-get install -y unzip zip build-essential pkg-config libssl-dev \ sudo apt install -y unzip zip curl
libxml2-dev zlib1g-dev libsqlite3-dev autoconf automake libtool wget gettext
# ---------------- Windows Package ----------------
- name: Prepare Windows package - name: Prepare Windows package
run: | run: |
set -e set -e
@@ -34,7 +28,6 @@ jobs:
cp yt-playlist-config.json dist/windows/ cp yt-playlist-config.json dist/windows/
curl -L -o dist/windows/yt-dlp.exe https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe curl -L -o dist/windows/yt-dlp.exe https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe
curl -L -o dist/windows/ffmpeg.zip https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip curl -L -o dist/windows/ffmpeg.zip https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip
unzip -q dist/windows/ffmpeg.zip -d dist/windows/ffmpeg_temp unzip -q dist/windows/ffmpeg.zip -d dist/windows/ffmpeg_temp
mv $(find dist/windows/ffmpeg_temp -name ffmpeg.exe | head -n 1) dist/windows/ffmpeg.exe mv $(find dist/windows/ffmpeg_temp -name ffmpeg.exe | head -n 1) dist/windows/ffmpeg.exe
@@ -46,7 +39,26 @@ jobs:
cd dist/windows cd dist/windows
zip -r ../../yt-playlist-windows-${CI_COMMIT_TAG}.zip * zip -r ../../yt-playlist-windows-${CI_COMMIT_TAG}.zip *
# ---------------- Linux Package ---------------- - name: Upload Windows release
uses: https://gitea.com/actions/gitea-release-action@v1
with:
files: yt-playlist-windows-${CI_COMMIT_TAG}.zip
linux-package:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: https://gitea.com/actions/checkout@v5
- name: Set up Python
uses: https://gitea.com/actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install --upgrade pip
sudo apt update
sudo apt install -y unzip zip build-essential pkg-config libssl-dev \
libxml2-dev zlib1g-dev libsqlite3-dev autoconf automake libtool wget gettext curl
- name: Prepare Linux package - name: Prepare Linux package
run: | run: |
set -e set -e
@@ -54,16 +66,18 @@ jobs:
cp yt-playlist-main.py dist/linux/ cp yt-playlist-main.py dist/linux/
cp yt-playlist-config.json dist/linux/ cp yt-playlist-config.json dist/linux/
# yt-dlp
curl -L -o dist/linux/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux curl -L -o dist/linux/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux
chmod +x dist/linux/yt-dlp chmod +x dist/linux/yt-dlp
# FFmpeg
curl -L -o dist/linux/ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz curl -L -o dist/linux/ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
mkdir -p dist/linux/ffmpeg_temp mkdir -p dist/linux/ffmpeg_temp
tar -xf dist/linux/ffmpeg.tar.xz -C dist/linux/ffmpeg_temp --strip-components=1 tar -xf dist/linux/ffmpeg.tar.xz -C dist/linux/ffmpeg_temp --strip-components=1
mv dist/linux/ffmpeg_temp/ffmpeg dist/linux/ffmpeg mv dist/linux/ffmpeg_temp/ffmpeg dist/linux/ffmpeg
chmod +x dist/linux/ffmpeg chmod +x dist/linux/ffmpeg
# ---------------- Build aria2c from source ---------------- # aria2c build
mkdir -p dist/linux/aria2c_build mkdir -p dist/linux/aria2c_build
cd dist/linux/aria2c_build cd dist/linux/aria2c_build
wget https://github.com/aria2/aria2/releases/download/release-1.37.0/aria2-1.37.0.tar.gz wget https://github.com/aria2/aria2/releases/download/release-1.37.0/aria2-1.37.0.tar.gz
@@ -79,17 +93,7 @@ jobs:
cd dist/linux cd dist/linux
zip -r ../../yt-playlist-linux-${CI_COMMIT_TAG}.zip * zip -r ../../yt-playlist-linux-${CI_COMMIT_TAG}.zip *
# ---------------- Clean up ---------------- - name: Upload Linux release
- name: Clean up
run: |
set -e
rm -rf dist/windows/ffmpeg_temp dist/windows/aria2-1.37.0-win-64bit-build1
rm -rf dist/linux/ffmpeg_temp dist/linux/aria2c_build
# ---------------- Upload Release Assets ----------------
- name: Upload release assets
uses: https://gitea.com/actions/gitea-release-action@v1 uses: https://gitea.com/actions/gitea-release-action@v1
with: with:
files: | files: yt-playlist-linux-${CI_COMMIT_TAG}.zip
yt-playlist-windows-${CI_COMMIT_TAG}.zip
yt-playlist-linux-${CI_COMMIT_TAG}.zip