Add Gitea Actions CI for Windows, macOS, and Linux builds

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Michael-A-SloanandCursor committed 2026-05-15 10:48:57 -04:00
1 parent 5d2933ea95
commit ad6e35ac4e
8 files changed
+399 -1

No files matched your search

+77 -1
View File
@@ -6,8 +6,64 @@ You can ship **Scribd PDF Downloader** as a standalone app on Windows and macOS.
|----------|--------|---------------|
| Windows | `dist/Scribd PDF Downloader/Scribd PDF Downloader.exe` + zip | Windows PC |
| macOS | `dist/Scribd PDF Downloader.app` + zip | MacBook Pro / any Mac |
| Linux | `dist/Scribd PDF Downloader/` + `.tar.gz` | Linux PC |
The app bundles **Python + Chromium** (~200–350 MB). No separate Python install is required on the target machine.
The app bundles **Python + Chromium** (~200–850 MB). No separate Python install is required on the target machine.
---
## CI builds (Gitea / GitHub Actions)
Automated builds for **Windows, macOS, and Linux** run from the repo root.
| Workflow | Trigger | Output |
|----------|---------|--------|
| **Build Scribd** | Push to `main`, PR, or manual | Artifacts per OS |
| **Release Scribd** | Tag `v*` (e.g. `v1.0.0`) | Gitea Release with all zips |
### Enable on Gitea (git.masengr.com)
1. **Site admin:** enable **Actions** for the instance.
2. **Repo → Settings → Actions:** allow workflows.
3. Register **act runners** with labels:
- `ubuntu-latest` (Linux builds)
- `windows-latest` (Windows builds)
- `macos-latest` (macOS builds — requires a Mac runner)
A single Linux runner will only build the **linux** job; Windows/macOS need matching runners or use GitHub Actions as a mirror.
4. Open **Actions** tab → run **Build Scribd** manually (`workflow_dispatch`).
Download artifacts from the completed workflow run.
### Workflows (repo root)
```
.gitea/workflows/build-scribd.yml # main CI
.gitea/workflows/release-scribd.yml # tagged releases
.github/workflows/build-scribd.yml # GitHub mirror
```
CI scripts live in `Scribd/build/ci/` (`build-windows.ps1`, `build-unix.sh`).
### Create a release
```bash
git tag v1.0.0
git push origin v1.0.0
```
Optional: add repo secret **`GITEA_TOKEN`** (releases scope) for `release-scribd.yml`.
### Artifact names
| Artifact | File |
|----------|------|
| `scribd-windows` | `Scribd-PDF-Downloader-Windows.zip` |
| `scribd-macos` | `Scribd-PDF-Downloader-macOS.zip` |
| `scribd-linux` | `Scribd-PDF-Downloader-Linux.tar.gz` |
> **Note:** Each archive is large (~500–900 MB) because Chromium is bundled. Hosted runners may hit artifact size limits; self-hosted runners avoid that.
---
@@ -59,6 +115,26 @@ For distribution outside your Mac, use an **Apple Developer ID** certificate and
---
## Linux
```bash
chmod +x build/ci/build-unix.sh
./build/ci/build-unix.sh
```
Output: `dist/Scribd-PDF-Downloader-Linux.tar.gz`
Extract and run:
```bash
tar -xzf dist/Scribd-PDF-Downloader-Linux.tar.gz -C dist
./dist/Scribd\ PDF\ Downloader/Scribd\ PDF\ Downloader
```
Requires a desktop environment (GUI uses tkinter).
---
## Troubleshooting builds
| Issue | Fix |
+42
View File
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
# CI build script for macOS and Linux (Gitea/GitHub Actions).
set -euo pipefail
echo "=== CI build: $(uname -s) ==="
python -m pip install --upgrade pip
pip install -r requirements-build.txt
export PLAYWRIGHT_BROWSERS_PATH=0
playwright install chromium
if [[ "$(uname)" == "Linux" ]]; then
sudo apt-get update
sudo apt-get install -y python3-tk tk-dev
sudo playwright install-deps chromium
fi
pyinstaller --noconfirm --clean build/scribd_gui.spec
if [[ "$(uname)" == "Darwin" ]]; then
APP="dist/Scribd PDF Downloader.app"
if [[ ! -d "$APP" ]]; then
echo "Error: $APP not found"
exit 1
fi
codesign --force --deep --sign - "$APP" 2>/dev/null || true
rm -f "dist/Scribd-PDF-Downloader-macOS.zip"
ditto -c -k --sequesterRsrc --keepParent "$APP" "dist/Scribd-PDF-Downloader-macOS.zip"
echo "Created dist/Scribd-PDF-Downloader-macOS.zip"
else
DIR="dist/Scribd PDF Downloader"
if [[ ! -d "$DIR" ]]; then
echo "Error: $DIR not found"
exit 1
fi
cp -f config.ini "$DIR/" 2>/dev/null || true
chmod +x "$DIR/Scribd PDF Downloader" 2>/dev/null || true
rm -f "dist/Scribd-PDF-Downloader-Linux.tar.gz"
tar -czf "dist/Scribd-PDF-Downloader-Linux.tar.gz" -C dist "Scribd PDF Downloader"
echo "Created dist/Scribd-PDF-Downloader-Linux.tar.gz"
fi
+25
View File
@@ -0,0 +1,25 @@
# CI build script for Windows (used by Gitea/GitHub Actions).
$ErrorActionPreference = "Stop"
Write-Host "=== CI build: Windows ===" -ForegroundColor Cyan
python -m pip install --upgrade pip
pip install -r requirements-build.txt
$env:PLAYWRIGHT_BROWSERS_PATH = "0"
playwright install chromium
pyinstaller --noconfirm --clean "build\scribd_gui.spec"
$Dist = "dist\Scribd PDF Downloader"
if (-not (Test-Path $Dist)) {
throw "Build output not found: $Dist"
}
Copy-Item "config.ini" $Dist -Force -ErrorAction SilentlyContinue
$Zip = "dist\Scribd-PDF-Downloader-Windows.zip"
if (Test-Path $Zip) { Remove-Item $Zip -Force }
Compress-Archive -Path $Dist -DestinationPath $Zip
Write-Host "Created $Zip" -ForegroundColor Green