CI: Linux runner builds Linux app and Windows portable zip
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
40bb5808ed
commit
2e36b189cf
8 files changed
+166
-129
No files matched your search
@@ -1,5 +1,8 @@
|
|||||||
# Build Scribd PDF Downloader for Windows, macOS, and Linux.
|
# CI for a Linux-only Gitea runner (ubuntu-latest).
|
||||||
# Requires runners with labels: ubuntu-latest, windows-latest, macos-latest
|
#
|
||||||
|
# - linux job: native .tar.gz with bundled Chromium (PyInstaller)
|
||||||
|
# - windows-portable job: zip for Windows (install .bat + source — runs on user's PC)
|
||||||
|
# True Windows .exe cannot be built on Linux (Playwright needs Windows binaries).
|
||||||
|
|
||||||
name: Build Scribd
|
name: Build Scribd
|
||||||
|
|
||||||
@@ -21,50 +24,44 @@ env:
|
|||||||
PYTHON_VERSION: "3.12"
|
PYTHON_VERSION: "3.12"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-linux:
|
||||||
name: Build (${{ matrix.platform }})
|
name: Linux (.tar.gz)
|
||||||
runs-on: ${{ matrix.runs-on }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- platform: windows
|
|
||||||
runs-on: windows-latest
|
|
||||||
artifact: Scribd-PDF-Downloader-Windows.zip
|
|
||||||
- platform: macos
|
|
||||||
runs-on: macos-latest
|
|
||||||
artifact: Scribd-PDF-Downloader-macOS.zip
|
|
||||||
- platform: linux
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
artifact: Scribd-PDF-Downloader-Linux.tar.gz
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Python
|
- uses: actions/setup-python@v5
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
cache: pip
|
cache: pip
|
||||||
cache-dependency-path: ${{ env.SCRIBD_DIR }}/requirements-build.txt
|
cache-dependency-path: ${{ env.SCRIBD_DIR }}/requirements-build.txt
|
||||||
|
|
||||||
- name: Build (Windows)
|
- name: Build Linux package
|
||||||
if: matrix.platform == 'windows'
|
|
||||||
shell: pwsh
|
|
||||||
working-directory: ${{ env.SCRIBD_DIR }}
|
|
||||||
run: ./build/ci/build-windows.ps1
|
|
||||||
|
|
||||||
- name: Build (macOS / Linux)
|
|
||||||
if: matrix.platform != 'windows'
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ env.SCRIBD_DIR }}
|
working-directory: ${{ env.SCRIBD_DIR }}
|
||||||
run: chmod +x ./build/ci/build-unix.sh && ./build/ci/build-unix.sh
|
run: chmod +x ./build/ci/build-unix.sh && ./build/ci/build-unix.sh
|
||||||
|
|
||||||
- name: Upload artifact
|
- uses: actions/upload-artifact@v4
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: scribd-${{ matrix.platform }}
|
name: scribd-linux
|
||||||
path: ${{ env.SCRIBD_DIR }}/dist/${{ matrix.artifact }}
|
path: ${{ env.SCRIBD_DIR }}/dist/Scribd-PDF-Downloader-Linux.tar.gz
|
||||||
|
retention-days: 14
|
||||||
|
|
||||||
|
build-windows-portable:
|
||||||
|
name: Windows (portable zip)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Package Windows portable
|
||||||
|
working-directory: ${{ env.SCRIBD_DIR }}
|
||||||
|
run: |
|
||||||
|
chmod +x ./build/ci/package-windows-portable.sh
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install -y zip
|
||||||
|
./build/ci/package-windows-portable.sh
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: scribd-windows-portable
|
||||||
|
path: ${{ env.SCRIBD_DIR }}/dist/Scribd-PDF-Downloader-Windows-Portable.zip
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
if-no-files-found: error
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Release with Windows, macOS, and Linux builds attached.
|
# Release — Linux native build + Windows portable zip (Linux runner only).
|
||||||
|
|
||||||
name: Release Scribd
|
name: Release Scribd
|
||||||
|
|
||||||
@@ -18,58 +18,46 @@ env:
|
|||||||
PYTHON_VERSION: "3.12"
|
PYTHON_VERSION: "3.12"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-linux:
|
||||||
name: Build (${{ matrix.platform }})
|
name: Linux (.tar.gz)
|
||||||
runs-on: ${{ matrix.runs-on }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- platform: windows
|
|
||||||
runs-on: windows-latest
|
|
||||||
artifact: Scribd-PDF-Downloader-Windows.zip
|
|
||||||
- platform: macos
|
|
||||||
runs-on: macos-latest
|
|
||||||
artifact: Scribd-PDF-Downloader-macOS.zip
|
|
||||||
- platform: linux
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
artifact: Scribd-PDF-Downloader-Linux.tar.gz
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
cache: pip
|
cache: pip
|
||||||
cache-dependency-path: ${{ env.SCRIBD_DIR }}/requirements-build.txt
|
cache-dependency-path: ${{ env.SCRIBD_DIR }}/requirements-build.txt
|
||||||
|
- working-directory: ${{ env.SCRIBD_DIR }}
|
||||||
- name: Build (Windows)
|
|
||||||
if: matrix.platform == 'windows'
|
|
||||||
shell: pwsh
|
|
||||||
working-directory: ${{ env.SCRIBD_DIR }}
|
|
||||||
run: ./build/ci/build-windows.ps1
|
|
||||||
|
|
||||||
- name: Build (macOS / Linux)
|
|
||||||
if: matrix.platform != 'windows'
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ env.SCRIBD_DIR }}
|
|
||||||
run: chmod +x ./build/ci/build-unix.sh && ./build/ci/build-unix.sh
|
run: chmod +x ./build/ci/build-unix.sh && ./build/ci/build-unix.sh
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: scribd-${{ matrix.platform }}
|
name: scribd-linux
|
||||||
path: ${{ env.SCRIBD_DIR }}/dist/${{ matrix.artifact }}
|
path: ${{ env.SCRIBD_DIR }}/dist/Scribd-PDF-Downloader-Linux.tar.gz
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
build-windows-portable:
|
||||||
|
name: Windows (portable zip)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- working-directory: ${{ env.SCRIBD_DIR }}
|
||||||
|
run: |
|
||||||
|
chmod +x ./build/ci/package-windows-portable.sh
|
||||||
|
sudo apt-get update -qq && sudo apt-get install -y zip
|
||||||
|
./build/ci/package-windows-portable.sh
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: scribd-windows-portable
|
||||||
|
path: ${{ env.SCRIBD_DIR }}/dist/Scribd-PDF-Downloader-Windows-Portable.zip
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Create Gitea release
|
name: Create Gitea release
|
||||||
needs: build
|
needs: [build-linux, build-windows-portable]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifacts
|
- uses: actions/download-artifact@v4
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
path: artifacts
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# GitHub mirror — Windows, macOS, and Linux matrix
|
# GitHub mirror — Linux runner: native Linux build + Windows portable zip
|
||||||
|
|
||||||
name: Build Scribd
|
name: Build Scribd
|
||||||
|
|
||||||
@@ -20,48 +20,36 @@ env:
|
|||||||
PYTHON_VERSION: "3.12"
|
PYTHON_VERSION: "3.12"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-linux:
|
||||||
name: Build (${{ matrix.platform }})
|
name: Linux (.tar.gz)
|
||||||
runs-on: ${{ matrix.runs-on }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- platform: windows
|
|
||||||
runs-on: windows-latest
|
|
||||||
artifact: Scribd-PDF-Downloader-Windows.zip
|
|
||||||
- platform: macos
|
|
||||||
runs-on: macos-latest
|
|
||||||
artifact: Scribd-PDF-Downloader-macOS.zip
|
|
||||||
- platform: linux
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
artifact: Scribd-PDF-Downloader-Linux.tar.gz
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
cache: pip
|
cache: pip
|
||||||
cache-dependency-path: ${{ env.SCRIBD_DIR }}/requirements-build.txt
|
cache-dependency-path: ${{ env.SCRIBD_DIR }}/requirements-build.txt
|
||||||
|
- working-directory: ${{ env.SCRIBD_DIR }}
|
||||||
- name: Build (Windows)
|
|
||||||
if: matrix.platform == 'windows'
|
|
||||||
shell: pwsh
|
|
||||||
working-directory: ${{ env.SCRIBD_DIR }}
|
|
||||||
run: ./build/ci/build-windows.ps1
|
|
||||||
|
|
||||||
- name: Build (macOS / Linux)
|
|
||||||
if: matrix.platform != 'windows'
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ env.SCRIBD_DIR }}
|
|
||||||
run: chmod +x ./build/ci/build-unix.sh && ./build/ci/build-unix.sh
|
run: chmod +x ./build/ci/build-unix.sh && ./build/ci/build-unix.sh
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: scribd-${{ matrix.platform }}
|
name: scribd-linux
|
||||||
path: ${{ env.SCRIBD_DIR }}/dist/${{ matrix.artifact }}
|
path: ${{ env.SCRIBD_DIR }}/dist/Scribd-PDF-Downloader-Linux.tar.gz
|
||||||
|
retention-days: 14
|
||||||
|
|
||||||
|
build-windows-portable:
|
||||||
|
name: Windows (portable zip)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- working-directory: ${{ env.SCRIBD_DIR }}
|
||||||
|
run: |
|
||||||
|
chmod +x ./build/ci/package-windows-portable.sh
|
||||||
|
sudo apt-get update -qq && sudo apt-get install -y zip
|
||||||
|
./build/ci/package-windows-portable.sh
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: scribd-windows-portable
|
||||||
|
path: ${{ env.SCRIBD_DIR }}/dist/Scribd-PDF-Downloader-Windows-Portable.zip
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
if-no-files-found: error
|
|
||||||
@@ -16,7 +16,7 @@ Hosted on [Gitea](https://git.masengr.com/Michael-A-Sloan/PDF-Downloaders).
|
|||||||
- Download **Artifacts** from the Actions tab after a green run
|
- Download **Artifacts** from the Actions tab after a green run
|
||||||
- Tag `v1.0.0` to trigger [release-scribd.yml](.gitea/workflows/release-scribd.yml)
|
- Tag `v1.0.0` to trigger [release-scribd.yml](.gitea/workflows/release-scribd.yml)
|
||||||
|
|
||||||
CI builds **Windows, macOS, and Linux** on every push (same runner labels as your other repos). See [Scribd/BUILD.md](Scribd/BUILD.md#ci-builds-gitea--github-actions).
|
CI (Linux runner) builds **Linux app** + **Windows portable zip** on every push. See [Scribd/BUILD.md](Scribd/BUILD.md#ci-builds-gitea--github-actions).
|
||||||
|
|
||||||
## Scribd
|
## Scribd
|
||||||
|
|
||||||
|
|||||||
+26
-20
@@ -29,29 +29,34 @@ Automated builds for **Windows, macOS, and Linux** run from the repo root.
|
|||||||
|
|
||||||
#### Runners (match your other repos)
|
#### Runners (match your other repos)
|
||||||
|
|
||||||
**Build Scribd** runs three jobs in parallel:
|
**Build Scribd** uses your **Linux runner** (`ubuntu-latest`) for two jobs:
|
||||||
|
|
||||||
| Job | `runs-on` label | Artifact |
|
| Job | What you get | Notes |
|
||||||
|-----|-----------------|----------|
|
|-----|----------------|-------|
|
||||||
| Linux | `ubuntu-latest` | `Scribd-PDF-Downloader-Linux.tar.gz` |
|
| **Linux** | `Scribd-PDF-Downloader-Linux.tar.gz` | Full standalone app (PyInstaller + Chromium) |
|
||||||
| Windows | `windows-latest` | `Scribd-PDF-Downloader-Windows.zip` |
|
| **Windows portable** | `Scribd-PDF-Downloader-Windows-Portable.zip` | Source + `Install Scribd Downloader.bat` |
|
||||||
| macOS | `macos-latest` | `Scribd-PDF-Downloader-macOS.zip` |
|
|
||||||
|
|
||||||
Your runner `b0c969454d0f` currently lists `ubuntu-latest` only. If other repos build all OSes on the same host, add the same labels there (Gitea **Admin → Actions → Runners → edit labels**, or in `act_runner` config):
|
### Why not a Windows `.exe` from Linux?
|
||||||
|
|
||||||
```yaml
|
Playwright ships **OS-specific Chromium**. PyInstaller cannot cross-compile this app from Linux to a real Windows `.exe`. That requires either:
|
||||||
# Example act_runner config (same pattern as your other repos)
|
|
||||||
labels:
|
- A **Windows machine** / `windows-latest` runner, or
|
||||||
- "ubuntu-latest:docker://node:20-bookworm"
|
- Local build: `.\build\windows\build.ps1` on your PC
|
||||||
- "windows-latest:docker://..." # Windows container image your infra uses
|
|
||||||
- "macos-latest:docker://..." # macOS VM or remote runner
|
### Windows portable zip (from Linux CI)
|
||||||
|
|
||||||
|
1. Download artifact **`scribd-windows-portable`**
|
||||||
|
2. Extract on a Windows PC
|
||||||
|
3. Run **`Install Scribd Downloader.bat`** (installs Python deps + Chromium once, then opens GUI)
|
||||||
|
|
||||||
|
### Linux CI artifact
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tar -xzf Scribd-PDF-Downloader-Linux.tar.gz
|
||||||
|
./Scribd\ PDF\ Downloader/Scribd\ PDF\ Downloader
|
||||||
```
|
```
|
||||||
|
|
||||||
Use the **exact label names** that work on your other repositories.
|
4. Open **Actions** → **Build Scribd** on push to `main`.
|
||||||
|
|
||||||
4. Open **Actions** → **Build Scribd** (runs on every push to `main` under `Scribd/`).
|
|
||||||
|
|
||||||
Download artifacts: `scribd-windows`, `scribd-macos`, `scribd-linux`.
|
|
||||||
|
|
||||||
### Workflows (repo root)
|
### Workflows (repo root)
|
||||||
|
|
||||||
@@ -76,9 +81,10 @@ Optional: add repo secret **`GITEA_TOKEN`** (releases scope) for `release-scribd
|
|||||||
|
|
||||||
| Artifact | File |
|
| Artifact | File |
|
||||||
|----------|------|
|
|----------|------|
|
||||||
| `scribd-windows` | `Scribd-PDF-Downloader-Windows.zip` |
|
|
||||||
| `scribd-macos` | `Scribd-PDF-Downloader-macOS.zip` |
|
|
||||||
| `scribd-linux` | `Scribd-PDF-Downloader-Linux.tar.gz` |
|
| `scribd-linux` | `Scribd-PDF-Downloader-Linux.tar.gz` |
|
||||||
|
| `scribd-windows-portable` | `Scribd-PDF-Downloader-Windows-Portable.zip` |
|
||||||
|
|
||||||
|
For a full Windows `.exe`, build locally with `.\build\windows\build.ps1`.
|
||||||
|
|
||||||
> **Note:** Each archive is large (~500–900 MB) because Chromium is bundled. Hosted runners may hit artifact size limits; self-hosted runners avoid that.
|
> **Note:** Each archive is large (~500–900 MB) because Chromium is bundled. Hosted runners may hit artifact size limits; self-hosted runners avoid that.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build a Windows portable zip on Linux (no .exe — user runs install script on Windows).
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||||
|
STAGING="$ROOT/dist/Scribd-PDF-Downloader-Windows-Portable"
|
||||||
|
ZIP="$ROOT/dist/Scribd-PDF-Downloader-Windows-Portable.zip"
|
||||||
|
|
||||||
|
rm -rf "$STAGING" "$ZIP"
|
||||||
|
mkdir -p "$STAGING/scribd_downloader"
|
||||||
|
|
||||||
|
cp "$ROOT/gui.py" "$ROOT/main.py" "$ROOT/config.ini" "$ROOT/requirements.txt" "$STAGING/"
|
||||||
|
cp -r "$ROOT/scribd_downloader/." "$STAGING/scribd_downloader/"
|
||||||
|
cp "$ROOT/build/ci/windows-portable/Install Scribd Downloader.bat" "$STAGING/"
|
||||||
|
cp "$ROOT/build/ci/windows-portable/README-Windows.txt" "$STAGING/"
|
||||||
|
|
||||||
|
cd "$ROOT/dist"
|
||||||
|
zip -r "$(basename "$ZIP")" "$(basename "$STAGING")"
|
||||||
|
echo "Created $ZIP"
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
@echo off
|
||||||
|
title Scribd PDF Downloader - Setup
|
||||||
|
cd /d "%~dp0"
|
||||||
|
|
||||||
|
echo Installing Scribd PDF Downloader...
|
||||||
|
echo.
|
||||||
|
|
||||||
|
if not exist ".venv\Scripts\python.exe" (
|
||||||
|
echo Creating virtual environment...
|
||||||
|
python -m venv .venv
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo Python not found. Install Python 3.10+ from https://python.org
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
call .venv\Scripts\pip install -r requirements.txt
|
||||||
|
call .venv\Scripts\playwright install chromium
|
||||||
|
)
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Starting GUI...
|
||||||
|
call .venv\Scripts\python.exe gui.py
|
||||||
|
pause
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
Scribd PDF Downloader - Windows Portable
|
||||||
|
========================================
|
||||||
|
|
||||||
|
This package was built on Linux CI. It is NOT a single .exe file.
|
||||||
|
|
||||||
|
To run on Windows:
|
||||||
|
1. Extract this entire folder anywhere (e.g. Desktop\Scribd)
|
||||||
|
2. Double-click: Install Scribd Downloader.bat
|
||||||
|
3. First run installs Python dependencies and Chromium (needs internet)
|
||||||
|
4. The GUI opens automatically
|
||||||
|
|
||||||
|
For a standalone .exe (no Python install on the PC):
|
||||||
|
- Build on a Windows machine: build\windows\build.ps1
|
||||||
|
- Or add a windows-latest Gitea runner to CI
|
||||||
|
|
||||||
|
Legal: Use only for content you have lawful access to.
|
||||||
Reference in new issue
Block a user