diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index a53b5d6..c24f9e5 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -2,30 +2,24 @@ name: Build Release Packages on: push: - tags: - - "v*" + #tags: + #- "v*" jobs: - package: + windows-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 ---------------- + sudo apt update + sudo apt install -y unzip zip curl - name: Prepare Windows package run: | set -e @@ -34,7 +28,6 @@ jobs: 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 @@ -46,7 +39,26 @@ jobs: cd dist/windows 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 run: | set -e @@ -54,16 +66,18 @@ jobs: cp yt-playlist-main.py 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 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 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 ---------------- + # aria2c build 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 @@ -79,17 +93,7 @@ jobs: 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 + - name: Upload Linux release 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 + files: yt-playlist-linux-${CI_COMMIT_TAG}.zip \ No newline at end of file