CI: build Windows, macOS, and Linux on all pushes
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
45805a0976
commit
40bb5808ed
7 files changed
+58
-233
No files matched your search
@@ -1,60 +0,0 @@
|
||||
# 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
|
||||
@@ -1,7 +1,5 @@
|
||||
# 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.
|
||||
# Build Scribd PDF Downloader for Windows, macOS, and Linux.
|
||||
# Requires runners with labels: ubuntu-latest, windows-latest, macos-latest
|
||||
|
||||
name: Build Scribd
|
||||
|
||||
@@ -17,77 +15,28 @@ 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: ${{ fromJSON(needs.plan.outputs.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:
|
||||
- name: Checkout
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Release — Linux artifact by default (ubuntu-latest runner).
|
||||
# Enable Windows/macOS in manual run only if you have those runners.
|
||||
# Release with Windows, macOS, and Linux builds attached.
|
||||
|
||||
name: Release Scribd
|
||||
|
||||
@@ -13,56 +12,28 @@ 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: ${{ fromJSON(needs.plan.outputs.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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# GitHub mirror — same logic as .gitea/workflows/build-scribd.yml
|
||||
# GitHub mirror — Windows, macOS, and Linux matrix
|
||||
|
||||
name: Build Scribd
|
||||
|
||||
@@ -14,67 +14,28 @@ on:
|
||||
paths:
|
||||
- "Scribd/**"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
build_linux:
|
||||
description: "Build Linux — ubuntu-latest"
|
||||
type: boolean
|
||||
default: true
|
||||
build_windows:
|
||||
description: "Build Windows — windows-latest"
|
||||
type: boolean
|
||||
default: false
|
||||
build_macos:
|
||||
description: "Build macOS — macos-latest"
|
||||
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})
|
||||
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: ${{ fromJSON(needs.plan.outputs.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
|
||||
|
||||
@@ -67,9 +67,9 @@ PDF-Downloaders/
|
||||
Workflows in `.gitea/workflows/` build **Windows, macOS, and Linux** packages on push to `main`.
|
||||
|
||||
1. Enable **Actions** for the repo on git.masengr.com.
|
||||
2. Ensure runners exist with labels `ubuntu-latest`, `windows-latest`, `macos-latest`.
|
||||
3. Open **Actions → Build Scribd → Run workflow** (or push changes under `Scribd/`).
|
||||
4. Download artifacts from the completed run.
|
||||
2. Use the same runner labels as your other repos: `ubuntu-latest`, `windows-latest`, `macos-latest`.
|
||||
3. Push to `main` or open **Actions → Build Scribd → Run workflow**.
|
||||
4. Download artifacts: `scribd-windows`, `scribd-macos`, `scribd-linux`.
|
||||
|
||||
Details: [Scribd/BUILD.md](Scribd/BUILD.md#ci-builds-gitea--github-actions)
|
||||
|
||||
|
||||
@@ -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
|
||||
- Tag `v1.0.0` to trigger [release-scribd.yml](.gitea/workflows/release-scribd.yml)
|
||||
|
||||
Your Gitea runner (`ubuntu-latest`) builds **Linux** automatically. Windows/macOS need extra runners — see [Scribd/BUILD.md](Scribd/BUILD.md#ci-builds-gitea--github-actions).
|
||||
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).
|
||||
|
||||
## Scribd
|
||||
|
||||
|
||||
+20
-16
@@ -27,33 +27,37 @@ Automated builds for **Windows, macOS, and Linux** run from the repo root.
|
||||
2. **Repo → Settings → Actions:** allow workflows.
|
||||
3. Register **act runners** with the right labels.
|
||||
|
||||
#### Your current runner
|
||||
#### Runners (match your other repos)
|
||||
|
||||
| Runner ID | Labels | Can build |
|
||||
|-----------|--------|-----------|
|
||||
| `b0c969454d0f` | `ubuntu-latest`, `ubuntu-24.04`, `ubuntu-22.04` | **Linux only** |
|
||||
**Build Scribd** runs three jobs in parallel:
|
||||
|
||||
With this setup, **Build Scribd** runs only the **linux** job on push/PR (no stuck Windows/macOS jobs).
|
||||
| Job | `runs-on` label | Artifact |
|
||||
|-----|-----------------|----------|
|
||||
| Linux | `ubuntu-latest` | `Scribd-PDF-Downloader-Linux.tar.gz` |
|
||||
| Windows | `windows-latest` | `Scribd-PDF-Downloader-Windows.zip` |
|
||||
| macOS | `macos-latest` | `Scribd-PDF-Downloader-macOS.zip` |
|
||||
|
||||
To add more platforms later, register runners with:
|
||||
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):
|
||||
|
||||
| Label | Platform |
|
||||
|-------|----------|
|
||||
| `windows-latest` | Windows `.zip` |
|
||||
| `macos-latest` | macOS `.app` zip |
|
||||
```yaml
|
||||
# Example act_runner config (same pattern as your other repos)
|
||||
labels:
|
||||
- "ubuntu-latest:docker://node:20-bookworm"
|
||||
- "windows-latest:docker://..." # Windows container image your infra uses
|
||||
- "macos-latest:docker://..." # macOS VM or remote runner
|
||||
```
|
||||
|
||||
Then use **Run workflow** and enable **build_windows** / **build_macos**, or run **Build Scribd (all platforms)**.
|
||||
Use the **exact label names** that work on your other repositories.
|
||||
|
||||
4. Open **Actions** → **Build Scribd** → **Run workflow** (or push to `main`).
|
||||
4. Open **Actions** → **Build Scribd** (runs on every push to `main` under `Scribd/`).
|
||||
|
||||
Download artifact **`scribd-linux`** → `Scribd-PDF-Downloader-Linux.tar.gz`.
|
||||
Download artifacts: `scribd-windows`, `scribd-macos`, `scribd-linux`.
|
||||
|
||||
### Workflows (repo root)
|
||||
|
||||
```
|
||||
.gitea/workflows/build-scribd.yml # default CI (Linux on push)
|
||||
.gitea/workflows/build-scribd-multiplatform.yml # manual: all 3 OS (needs 3 runners)
|
||||
.gitea/workflows/release-scribd.yml # tagged releases
|
||||
.gitea/workflows/build-scribd.yml # Windows + macOS + Linux on push
|
||||
.gitea/workflows/release-scribd.yml # all platforms on tag v*
|
||||
.github/workflows/build-scribd.yml # GitHub mirror
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user