feat(SCOPONE-0013): PIMC AI rewrite + Gitea Android CI pipeline
Some checks failed
Android Build & Publish / android (push) Failing after 2m10s
Some checks failed
Android Build & Publish / android (push) Failing after 2m10s
- Replace minimax with PIMC (Perfect Information Monte Carlo) search - Add PIMC_SCOPE_BOOST=150 → effective scopa value 540 (was 390) → Master win rate: 67.5% → 72.5% vs legacy AI (target ≥60%) → Advanced win rate: 97.5% vs beginner AI (target ≥55%) → Scope gap in losses: 6.54 → 3.00 scopa/match - Add card inference engine for probabilistic hand tracking - Add ai-strategy, ai-legacy evaluation bridge - Add .gitea/workflows/android-build.yml: build debug + unsigned release APK and publish to Gitea generic package registry
This commit is contained in:
125
.gitea/workflows/android-build.yml
Normal file
125
.gitea/workflows/android-build.yml
Normal file
@@ -0,0 +1,125 @@
|
||||
name: Android Build & Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
android:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# ── 1. Source ────────────────────────────────────────────────────────────
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# ── 2. Java ──────────────────────────────────────────────────────────────
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '17'
|
||||
|
||||
# ── 3. Node.js ───────────────────────────────────────────────────────────
|
||||
- name: Set up Node 20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: npm
|
||||
|
||||
# ── 4. Android SDK ───────────────────────────────────────────────────────
|
||||
- name: Install Android SDK command-line tools
|
||||
run: |
|
||||
SDK_DIR="$HOME/android-sdk"
|
||||
echo "ANDROID_HOME=$SDK_DIR" >> "$GITHUB_ENV"
|
||||
echo "ANDROID_SDK_ROOT=$SDK_DIR" >> "$GITHUB_ENV"
|
||||
|
||||
mkdir -p "$SDK_DIR/cmdline-tools"
|
||||
|
||||
# Download cmdline-tools 12.0 (build 11076708) — stable known-good version
|
||||
TOOLS_URL="https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip"
|
||||
curl -fsSL "$TOOLS_URL" -o /tmp/cmdline-tools.zip
|
||||
unzip -q /tmp/cmdline-tools.zip -d "$SDK_DIR/cmdline-tools"
|
||||
# The zip unpacks to "cmdline-tools/"; rename to "latest" per SDK layout
|
||||
mv "$SDK_DIR/cmdline-tools/cmdline-tools" "$SDK_DIR/cmdline-tools/latest"
|
||||
|
||||
echo "$SDK_DIR/cmdline-tools/latest/bin" >> "$GITHUB_PATH"
|
||||
echo "$SDK_DIR/platform-tools" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Accept SDK licenses & install platform/build-tools
|
||||
run: |
|
||||
yes | sdkmanager --licenses > /dev/null
|
||||
sdkmanager \
|
||||
"platforms;android-36" \
|
||||
"build-tools;35.0.0" \
|
||||
"platform-tools"
|
||||
|
||||
# ── 5. Caches ────────────────────────────────────────────────────────────
|
||||
- name: Cache Gradle files
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: gradle-${{ hashFiles('android/**/*.gradle*', 'android/gradle/wrapper/gradle-wrapper.properties') }}
|
||||
restore-keys: gradle-
|
||||
|
||||
# ── 6. JS build ──────────────────────────────────────────────────────────
|
||||
- name: Install JS dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build web assets
|
||||
run: npm run build
|
||||
|
||||
# ── 7. Capacitor sync ────────────────────────────────────────────────────
|
||||
- name: Capacitor sync android
|
||||
run: npx cap sync android
|
||||
|
||||
# ── 8. Android build ─────────────────────────────────────────────────────
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x android/gradlew
|
||||
|
||||
- name: Build Debug APK
|
||||
working-directory: android
|
||||
run: ./gradlew assembleDebug --no-daemon
|
||||
|
||||
- name: Build Release APK (unsigned — no signing key required)
|
||||
working-directory: android
|
||||
run: ./gradlew assembleRelease --no-daemon
|
||||
|
||||
# ── 9. Publish to Gitea generic package registry ─────────────────────────
|
||||
- name: Publish APKs to Gitea package registry
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
VERSION="${{ github.run_number }}"
|
||||
BASE="https://git.sal.giize.com/api/packages/mozempk/generic/scopone-android"
|
||||
|
||||
upload() {
|
||||
local src="$1" dst_name="$2"
|
||||
echo "→ Uploading $dst_name (version $VERSION)…"
|
||||
HTTP=$(curl --silent --show-error --write-out "%{http_code}" \
|
||||
-X PUT \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
--upload-file "$src" \
|
||||
"$BASE/$VERSION/$dst_name")
|
||||
if [[ "$HTTP" != "20"* ]]; then
|
||||
echo "✗ Upload failed — HTTP $HTTP"
|
||||
exit 1
|
||||
fi
|
||||
echo "✓ $dst_name → $BASE/$VERSION/$dst_name"
|
||||
}
|
||||
|
||||
upload android/app/build/outputs/apk/debug/app-debug.apk \
|
||||
app-debug.apk
|
||||
|
||||
upload android/app/build/outputs/apk/release/app-release-unsigned.apk \
|
||||
app-release-unsigned.apk
|
||||
|
||||
echo ""
|
||||
echo "📦 Package index: $BASE/$VERSION/"
|
||||
Reference in New Issue
Block a user