All checks were successful
Build APK / build-apk (push) Successful in 5m25s
Der android-Ordner wurde bisher bei JEDEM CI-Lauf neu erzeugt (cap add android) und Kotlin/MainActivity/Plugin jedes Mal frisch reingepatcht — genau das war die Ursache der ganzen Kotlin-Build-Fehler. Jetzt liegt android/ einmal sauber eingerichtet im Repo: - kotlin-android-Plugin aktiviert (1.9.24, jvmTarget 17) - NetDiagScannerPlugin.kt + Snmp.kt + MainActivity.kt (registriert das Plugin) - AndroidManifest mit allen noetigen Permissions - Signing-Config in app/build.gradle (Werte aus gradle.properties) build.yml entschlackt: nur noch npm install, vite build, cap sync, gradle. Build-Artefakte bleiben per .gitignore aussen vor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
93 lines
3.4 KiB
YAML
93 lines
3.4 KiB
YAML
name: Build APK
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build-apk:
|
|
if: contains(github.event.head_commit.message, '[apk]')
|
|
runs-on: docker
|
|
steps:
|
|
- name: Notify Start
|
|
uses: https://git.data-it-solution.de/data/ntfy-action@main
|
|
with:
|
|
status: start
|
|
project: NetDiag APK
|
|
ntfy_auth: ${{ secrets.NTFY_AUTH }}
|
|
run_number: ${{ github.run_number }}
|
|
message: ${{ github.event.head_commit.message }}
|
|
|
|
- name: Repo klonen + Version festlegen
|
|
run: |
|
|
git clone https://data:${{ secrets.GIT_TOKEN }}@git.data-it-solution.de/data/netdiag-app.git .
|
|
git checkout ${{ github.sha }}
|
|
echo "$(date +%Y%m%d-%H%M)" > /tmp/BUILD_VERSION
|
|
|
|
- name: Node.js Dependencies installieren
|
|
run: npm install
|
|
|
|
- name: Frontend bauen
|
|
run: VITE_APP_VERSION="$(cat /tmp/BUILD_VERSION)" npx vite build
|
|
|
|
# android/ liegt komplett im Repo (Kotlin, Plugin, MainActivity, Manifest,
|
|
# Signing-Config sind dort fest eingerichtet). cap sync kopiert nur die
|
|
# Web-Assets rein und aktualisiert die Plugin-Liste.
|
|
- name: Capacitor sync
|
|
run: npx cap sync android
|
|
|
|
- name: Keystore + Signing-Properties vorbereiten
|
|
run: |
|
|
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > /tmp/release.jks
|
|
cat >> android/gradle.properties <<PROPS
|
|
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
|
|
RELEASE_STORE_FILE=/tmp/release.jks
|
|
RELEASE_STORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }}
|
|
RELEASE_KEY_ALIAS=${{ secrets.KEY_ALIAS }}
|
|
RELEASE_KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}
|
|
PROPS
|
|
|
|
- name: APK bauen (Release)
|
|
run: |
|
|
cd android
|
|
echo "sdk.dir=/opt/android-sdk" > local.properties
|
|
chmod +x gradlew
|
|
./gradlew assembleRelease --no-daemon
|
|
|
|
- name: APK in Package Registry hochladen
|
|
run: |
|
|
VERSION=$(cat /tmp/BUILD_VERSION)
|
|
APK_FILE=$(find android/app/build -name "*.apk" -path "*/release/*" | head -1)
|
|
echo "APK gefunden: $APK_FILE"
|
|
|
|
curl --fail --user "data:${{ secrets.REGISTRY_TOKEN }}" \
|
|
--upload-file "$APK_FILE" \
|
|
"https://git.data-it-solution.de/api/packages/data-it/generic/netdiag-apk/${VERSION}/NetDiag-${VERSION}.apk"
|
|
|
|
curl -s -X DELETE --user "data:${{ secrets.REGISTRY_TOKEN }}" \
|
|
"https://git.data-it-solution.de/api/v1/packages/data-it/generic/netdiag-apk/latest" || true
|
|
|
|
curl --fail --user "data:${{ secrets.REGISTRY_TOKEN }}" \
|
|
--upload-file "$APK_FILE" \
|
|
"https://git.data-it-solution.de/api/packages/data-it/generic/netdiag-apk/latest/NetDiag.apk"
|
|
|
|
echo "APK hochgeladen: ${VERSION} + latest"
|
|
|
|
- name: Notify Success
|
|
if: success()
|
|
uses: https://git.data-it-solution.de/data/ntfy-action@main
|
|
with:
|
|
status: success
|
|
project: NetDiag APK
|
|
ntfy_auth: ${{ secrets.NTFY_AUTH }}
|
|
run_number: ${{ github.run_number }}
|
|
|
|
- name: Notify Failure
|
|
if: failure()
|
|
uses: https://git.data-it-solution.de/data/ntfy-action@main
|
|
with:
|
|
status: failure
|
|
project: NetDiag APK
|
|
ntfy_auth: ${{ secrets.NTFY_AUTH }}
|
|
run_number: ${{ github.run_number }}
|
|
click_url: https://git.data-it-solution.de/${{ github.repository }}/actions
|