mirror of
https://github.com/darkzoul5/YoutubePlaylistSync.git
synced 2026-07-03 12:34:00 +03:00
96 lines
3.5 KiB
YAML
96 lines
3.5 KiB
YAML
name: Build Release Packages
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
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-get update
|
|
sudo apt-get install -y unzip zip build-essential pkg-config libssl-dev \
|
|
libxml2-dev zlib1g-dev libsqlite3-dev autoconf automake libtool wget gettext
|
|
|
|
# ---------------- Windows Package ----------------
|
|
- name: Prepare Windows package
|
|
run: |
|
|
set -e
|
|
mkdir -p dist/windows
|
|
cp yt-playlist-main.py 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/ffmpeg.zip https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip
|
|
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
|
|
|
|
curl -L -o dist/windows/aria2c.zip https://github.com/aria2/aria2/releases/download/release-1.37.0/aria2-1.37.0-win-64bit-build1.zip
|
|
unzip dist/windows/aria2c.zip -d dist/windows/
|
|
mv dist/windows/aria2-1.37.0-win-64bit-build1/aria2c.exe dist/windows/aria2c.exe
|
|
|
|
cd dist/windows
|
|
zip -r ../../yt-playlist-windows-${CI_COMMIT_TAG}.zip *
|
|
|
|
# ---------------- Linux Package ----------------
|
|
- name: Prepare Linux package
|
|
run: |
|
|
set -e
|
|
mkdir -p dist/linux
|
|
cp yt-playlist-main.py dist/linux/
|
|
cp yt-playlist-config.json dist/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
|
|
|
|
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
|
|
tar -xf dist/linux/ffmpeg.tar.xz -C dist/linux/ffmpeg_temp --strip-components=1
|
|
mv dist/linux/ffmpeg_temp/ffmpeg dist/linux/ffmpeg
|
|
chmod +x dist/linux/ffmpeg
|
|
|
|
# ---------------- Build aria2c from source ----------------
|
|
mkdir -p 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
|
|
tar -xzf aria2-1.37.0.tar.gz
|
|
cd aria2-1.37.0
|
|
autoreconf -i
|
|
./configure ARIA2_STATIC=yes --with-openssl
|
|
make -j$(nproc)
|
|
cp src/aria2c ../../aria2c
|
|
cd ../../
|
|
chmod +x dist/linux/aria2c
|
|
|
|
cd dist/linux
|
|
zip -r ../../yt-playlist-linux-${CI_COMMIT_TAG}.zip *
|
|
|
|
# ---------------- Clean up ----------------
|
|
- 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
|
|
with:
|
|
files: |
|
|
yt-playlist-windows-${CI_COMMIT_TAG}.zip
|
|
yt-playlist-linux-${CI_COMMIT_TAG}.zip
|