Add Gitea Actions CI for Windows, macOS, and Linux builds
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
5d2933ea95
commit
ad6e35ac4e
8 files changed
+399
-1
No files matched your search
@@ -0,0 +1,70 @@
|
||||
# Build Scribd PDF Downloader for Windows, macOS, and Linux.
|
||||
# Requires Gitea Actions enabled + runners (see Scribd/BUILD.md#ci-builds).
|
||||
|
||||
name: Build Scribd
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
paths:
|
||||
- "Scribd/**"
|
||||
- ".gitea/workflows/**"
|
||||
- ".github/workflows/**"
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
paths:
|
||||
- "Scribd/**"
|
||||
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:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
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
|
||||
@@ -0,0 +1,92 @@
|
||||
# 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.
|
||||
|
||||
name: Release Scribd
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Release tag (e.g. v1.0.0)"
|
||||
required: true
|
||||
default: "v1.0.0"
|
||||
|
||||
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: 30
|
||||
|
||||
release:
|
||||
name: Create Gitea release
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts
|
||||
merge-multiple: true
|
||||
|
||||
- name: Prepare files
|
||||
run: |
|
||||
mkdir -p release-files
|
||||
find artifacts -type f \( -name "*.zip" -o -name "*.tar.gz" \) -exec cp {} release-files/ \;
|
||||
ls -la release-files/
|
||||
|
||||
- name: Publish Gitea release
|
||||
uses: https://gitea.com/actions/gitea-release-action@v1
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
|
||||
files: release-files/*
|
||||
Reference in new issue
Block a user