Tune CI for ubuntu-only runner; Linux builds on push

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Michael-A-SloanandCursor committed 2026-05-15 10:50:48 -04:00
1 parent ad6e35ac4e
commit 45805a0976
6 files changed
+239 -53

No files matched your search

@@ -0,0 +1,60 @@
# Full Windows + macOS + Linux matrix — only use when you have runners for ALL labels:
# ubuntu-latest, windows-latest, macos-latest
#
# With only an ubuntu runner (e.g. b0c969454d0f), use build-scribd.yml instead.
name: Build Scribd (all platforms)
on:
workflow_dispatch:
env:
SCRIBD_DIR: Scribd
PYTHON_VERSION: "3.12"
jobs:
build:
name: Build (${{ matrix.platform }})
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
artifact: Scribd-PDF-Downloader-Linux.tar.gz
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: ${{ env.SCRIBD_DIR }}/requirements-build.txt
- 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
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: scribd-${{ matrix.platform }}
path: ${{ env.SCRIBD_DIR }}/dist/${{ matrix.artifact }}
retention-days: 14
if-no-files-found: error
+63 -12
View File
@@ -1,5 +1,7 @@
# Build Scribd PDF Downloader for Windows, macOS, and Linux.
# Requires Gitea Actions enabled + runners (see Scribd/BUILD.md#ci-builds).
# Build Scribd PDF Downloader — tuned for ubuntu-latest runners.
# Your runner (ubuntu-latest / 22.04 / 24.04) builds Linux packages.
# For Windows/macOS, register runners with those labels and use
# build-scribd-multiplatform.yml or enable optional inputs below.
name: Build Scribd
@@ -15,28 +17,77 @@ on:
paths:
- "Scribd/**"
workflow_dispatch:
inputs:
build_linux:
description: "Build Linux (.tar.gz) — needs ubuntu-latest runner"
type: boolean
default: true
build_windows:
description: "Build Windows (.zip) — needs windows-latest runner"
type: boolean
default: false
build_macos:
description: "Build macOS (.app zip) — needs macos-latest runner"
type: boolean
default: false
env:
SCRIBD_DIR: Scribd
PYTHON_VERSION: "3.12"
jobs:
plan:
name: Plan builds
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.plan.outputs.matrix }}
steps:
- id: plan
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
BUILD_LINUX: ${{ github.event_name == 'workflow_dispatch' && inputs.build_linux || 'true' }}
BUILD_WINDOWS: ${{ github.event_name == 'workflow_dispatch' && inputs.build_windows || 'false' }}
BUILD_MACOS: ${{ github.event_name == 'workflow_dispatch' && inputs.build_macos || 'false' }}
run: |
python3 <<'PY'
import json, os
matrix = []
event = os.environ.get("EVENT_NAME", "")
def add(platform, runs_on, artifact):
matrix.append({
"platform": platform,
"runs-on": runs_on,
"artifact": artifact,
})
# Push/PR: Linux only (matches typical Gitea ubuntu runner)
if event in ("push", "pull_request"):
add("linux", "ubuntu-latest", "Scribd-PDF-Downloader-Linux.tar.gz")
else:
if os.environ.get("BUILD_LINUX", "true").lower() == "true":
add("linux", "ubuntu-latest", "Scribd-PDF-Downloader-Linux.tar.gz")
if os.environ.get("BUILD_WINDOWS", "false").lower() == "true":
add("windows", "windows-latest", "Scribd-PDF-Downloader-Windows.zip")
if os.environ.get("BUILD_MACOS", "false").lower() == "true":
add("macos", "macos-latest", "Scribd-PDF-Downloader-macOS.zip")
if not matrix:
raise SystemExit("No platforms selected.")
print("matrix=" + json.dumps(matrix))
PY
build:
name: Build (${{ matrix.platform }})
needs: plan
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
artifact: Scribd-PDF-Downloader-Linux.tar.gz
include: ${{ fromJSON(needs.plan.outputs.matrix) }}
steps:
- name: Checkout
+40 -14
View File
@@ -1,7 +1,5 @@
# Attach built Scribd artifacts to a Gitea Release (optional).
# Create tag v1.0.0 on main, then run workflow OR push the tag to trigger.
#
# Secret: add repo secret GITEA_TOKEN (write packages/releases) if auto token is insufficient.
# Release — Linux artifact by default (ubuntu-latest runner).
# Enable Windows/macOS in manual run only if you have those runners.
name: Release Scribd
@@ -15,28 +13,56 @@ on:
description: "Release tag (e.g. v1.0.0)"
required: true
default: "v1.0.0"
build_windows:
description: "Include Windows build (needs windows-latest runner)"
type: boolean
default: false
build_macos:
description: "Include macOS build (needs macos-latest runner)"
type: boolean
default: false
env:
SCRIBD_DIR: Scribd
PYTHON_VERSION: "3.12"
jobs:
plan:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.plan.outputs.matrix }}
steps:
- id: plan
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
BUILD_WINDOWS: ${{ github.event_name == 'workflow_dispatch' && inputs.build_windows || 'false' }}
BUILD_MACOS: ${{ github.event_name == 'workflow_dispatch' && inputs.build_macos || 'false' }}
run: |
python3 <<'PY'
import json, os
matrix = [{"platform": "linux", "runs-on": "ubuntu-latest",
"artifact": "Scribd-PDF-Downloader-Linux.tar.gz"}]
if os.environ.get("BUILD_WINDOWS", "false").lower() == "true":
matrix.append({"platform": "windows", "runs-on": "windows-latest",
"artifact": "Scribd-PDF-Downloader-Windows.zip"})
if os.environ.get("BUILD_MACOS", "false").lower() == "true":
matrix.append({"platform": "macos", "runs-on": "macos-latest",
"artifact": "Scribd-PDF-Downloader-macOS.zip"})
print("matrix=" + json.dumps(matrix))
PY
build:
name: Build (${{ matrix.platform }})
needs: plan
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
artifact: Scribd-PDF-Downloader-Linux.tar.gz
include: ${{ fromJSON(needs.plan.outputs.matrix) }}
steps:
- uses: actions/checkout@v4