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
+59
-234
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user