Some checks are pending
Build Android (APK + AAB) / build-android (push) Waiting to run
LEGAL - GET /termos: termos de uso completos (11 seções) com aviso CRÍTICO de limitação de responsabilidade pra navegação náutica (não substitui chartplotter/cartas/atenção do skipper) - Reembolso CDC art. 49 (7 dias arrependimento) explicito - Lei aplicável Brasil + foro SP CI/CD - .forgejo/workflows/build-android.yml: pipeline completo (checkout → JDK17 → Android SDK → npm install mobile/ → cap sync → gradle bundleRelease + assembleRelease → upload artifacts → release no manual) - .forgejo/workflows/README.md: como configurar runner Forgejo no Coolify, secrets necessários (KEYSTORE_BASE64, KEYSTORE_PWD, FORGEJO_TOKEN), alternativas (Codemagic, GitHub Actions) - Trigger automático em push em app/, mobile/, scripts/sync-html.mjs - Trigger manual via botão Forgejo VALIDADO - Bundletool 1.17.2 instalado em ~/bundletool/ - AAB validado: arquivos OK - APK por device gerado: 2.8-2.9 MB (vs 3.4 MB universal — Play Store entrega menor) - ~/Downloads/Shivao-v1.2.0.apks (12MB, contém splits por arquitetura) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
97 lines
3 KiB
YAML
97 lines
3 KiB
YAML
name: Build Android (APK + AAB)
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
paths:
|
|
- 'app/**'
|
|
- 'mobile/**'
|
|
- 'scripts/sync-html.mjs'
|
|
- '.forgejo/workflows/build-android.yml'
|
|
workflow_dispatch: {} # botão manual no painel Forgejo
|
|
|
|
jobs:
|
|
build-android:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # pra upload de release
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Setup JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '17'
|
|
|
|
- name: Setup Android SDK
|
|
uses: android-actions/setup-android@v3
|
|
with:
|
|
packages: 'platforms;android-34 build-tools;34.0.0 platform-tools'
|
|
|
|
- name: Install root deps (sync script)
|
|
run: |
|
|
cd "${{ github.workspace }}"
|
|
# Sem package.json no root, script é puro Node ESM
|
|
node --version
|
|
|
|
- name: Sync HTML (1 fonte → server + mobile)
|
|
run: node scripts/sync-html.mjs
|
|
|
|
- name: Install Capacitor deps
|
|
working-directory: mobile
|
|
run: npm ci --ignore-scripts
|
|
|
|
- name: Capacitor sync
|
|
working-directory: mobile
|
|
run: npx cap sync android
|
|
|
|
- name: Decode keystore from secrets
|
|
run: |
|
|
echo "${{ secrets.SHIVAO_KEYSTORE_BASE64 }}" | base64 --decode > mobile/android/app/shivao-release.keystore
|
|
ls -lh mobile/android/app/shivao-release.keystore
|
|
|
|
- name: Build APK + AAB (release, signed)
|
|
working-directory: mobile/android
|
|
env:
|
|
SHIVAO_KEYSTORE_PWD: ${{ secrets.SHIVAO_KEYSTORE_PWD }}
|
|
run: |
|
|
chmod +x ./gradlew
|
|
./gradlew bundleRelease assembleRelease --no-daemon --stacktrace
|
|
|
|
- name: Rename artifacts with version
|
|
run: |
|
|
VERSION=$(grep "versionName" mobile/android/app/build.gradle | head -1 | grep -oE '"[^"]+"' | tr -d '"')
|
|
echo "Version: $VERSION"
|
|
cp mobile/android/app/build/outputs/apk/release/app-release.apk Shivao-v${VERSION}.apk
|
|
cp mobile/android/app/build/outputs/bundle/release/app-release.aab Shivao-v${VERSION}.aab
|
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
|
|
- name: Upload APK + AAB as artifacts (CI)
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: shivao-android-${{ env.VERSION }}
|
|
path: |
|
|
Shivao-v${{ env.VERSION }}.apk
|
|
Shivao-v${{ env.VERSION }}.aab
|
|
|
|
- name: Create Forgejo release
|
|
if: github.event_name == 'workflow_dispatch'
|
|
uses: actions/forgejo-release@v2
|
|
with:
|
|
direction: upload
|
|
tag: v${{ env.VERSION }}-ci
|
|
title: "Shivao v${{ env.VERSION }} (CI build)"
|
|
files: |
|
|
Shivao-v${{ env.VERSION }}.apk
|
|
Shivao-v${{ env.VERSION }}.aab
|
|
token: ${{ secrets.FORGEJO_TOKEN }}
|
|
url: https://git.pontualtech.work
|
|
repo: karlao/shivao-projeto
|