ci: add Gitea Actions workflows for .exe and APK builds
- build-exe.yml: Python server → PyInstaller → PaperDash.exe (windows-latest) - build-apk.yml: Android project → Gradle → app-debug.apk (ubuntu-latest) - Both trigger on push/PR to main when relevant paths change
This commit is contained in:
@@ -0,0 +1,58 @@
|
|||||||
|
name: Build Android APK
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- "android/**"
|
||||||
|
- "client/**"
|
||||||
|
- ".gitea/workflows/build-apk.yml"
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- "android/**"
|
||||||
|
- "client/**"
|
||||||
|
- ".gitea/workflows/build-apk.yml"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: "17"
|
||||||
|
distribution: "temurin"
|
||||||
|
|
||||||
|
- name: Sync client assets
|
||||||
|
run: |
|
||||||
|
cp client/index.html android/app/src/main/assets/index.html
|
||||||
|
cp client/style.css android/app/src/main/assets/style.css
|
||||||
|
cp client/app.js android/app/src/main/assets/app.js
|
||||||
|
|
||||||
|
- name: Setup Android SDK
|
||||||
|
uses: android-actions/setup-android@v3
|
||||||
|
with:
|
||||||
|
cmdline-tools-version: 11076708
|
||||||
|
platforms: "platform-34"
|
||||||
|
build-tools: "34.0.0"
|
||||||
|
|
||||||
|
- name: Build APK (debug)
|
||||||
|
working-directory: android
|
||||||
|
run: |
|
||||||
|
chmod +x gradlew || true
|
||||||
|
./gradlew assembleDebug
|
||||||
|
env:
|
||||||
|
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||||
|
|
||||||
|
- name: Upload debug APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: PaperDash-debug.apk
|
||||||
|
path: android/app/build/outputs/apk/debug/app-debug.apk
|
||||||
|
if-no-files-found: error
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
name: Build Server .exe
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- "server/**"
|
||||||
|
- ".gitea/workflows/build-exe.yml"
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- "server/**"
|
||||||
|
- ".gitea/workflows/build-exe.yml"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.12"
|
||||||
|
cache: "pip"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
cd server
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
cd server
|
||||||
|
pip install pytest pytest-asyncio
|
||||||
|
pytest tests/ -v
|
||||||
|
|
||||||
|
- name: Build .exe
|
||||||
|
run: |
|
||||||
|
cd server
|
||||||
|
python build_exe.py
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: PaperDash.exe
|
||||||
|
path: server/dist/PaperDash.exe
|
||||||
|
if-no-files-found: error
|
||||||
Reference in New Issue
Block a user