From ad84bc52ce6021972b1458d0ede82b2670557a82 Mon Sep 17 00:00:00 2001 From: Imrayya Date: Wed, 1 Jul 2026 11:22:13 +0000 Subject: [PATCH] ci: add Gitea Actions workflows for .exe and APK builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .gitea/workflows/build-apk.yml | 58 ++++++++++++++++++++++++++++++++++ .gitea/workflows/build-exe.yml | 52 ++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 .gitea/workflows/build-apk.yml create mode 100644 .gitea/workflows/build-exe.yml diff --git a/.gitea/workflows/build-apk.yml b/.gitea/workflows/build-apk.yml new file mode 100644 index 0000000..2ed0afc --- /dev/null +++ b/.gitea/workflows/build-apk.yml @@ -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 diff --git a/.gitea/workflows/build-exe.yml b/.gitea/workflows/build-exe.yml new file mode 100644 index 0000000..8823239 --- /dev/null +++ b/.gitea/workflows/build-exe.yml @@ -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