mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-02-04 07:23:18 +00:00
86 lines
2.9 KiB
YAML
86 lines
2.9 KiB
YAML
# Build Android version of the app
|
|
|
|
name: Android
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Prepare Nix devshell
|
|
uses: ./.github/actions/nix-devshell
|
|
with:
|
|
prebuild: "true"
|
|
|
|
- name: Collect Translation Files
|
|
uses: ./.github/actions/nix-devshell
|
|
with:
|
|
commands: |
|
|
cd lib/l10n
|
|
python3 collect_translations.py
|
|
|
|
# - name: Build Debug APK
|
|
# uses: ./.github/actions/nix-devshell
|
|
# with:
|
|
# commands: |
|
|
# flutter build apk --debug --target-platform android-arm64
|
|
|
|
# - name: Upload APK artifact
|
|
# uses: actions/upload-artifact@v4
|
|
# with:
|
|
# name: app-debug-apk
|
|
# path: build/app/outputs/flutter-apk/*.apk
|
|
# # retention-days: 90
|
|
|
|
- name: Setup Release Keystore
|
|
uses: ./.github/actions/nix-devshell
|
|
with:
|
|
commands: |
|
|
# Write keystore into android/app and key.properties into android/
|
|
echo "$RELEASE_KEYSTORE_BASE64" | base64 -d > android/app/inventree-release-key.jks
|
|
chmod 600 android/app/inventree-release-key.jks
|
|
|
|
# Write key.properties inside android/ (user preferred) and also at repo root
|
|
printf "storePassword=%s\nkeyPassword=%s\nkeyAlias=%s\nstoreFile=%s\n" \
|
|
"$STORE_PASSWORD" "$KEY_PASSWORD" "$KEY_ALIAS" "android/app/inventree-release-key.jks" \
|
|
> android/key.properties
|
|
printf "storePassword=%s\nkeyPassword=%s\nkeyAlias=%s\nstoreFile=%s\n" \
|
|
"$STORE_PASSWORD" "$KEY_PASSWORD" "$KEY_ALIAS" "android/app/inventree-release-key.jks" \
|
|
> key.properties
|
|
|
|
# Debug: show files so we can confirm Gradle will find them
|
|
echo "=== repo root ==="
|
|
ls -la . | sed -n '1,200p'
|
|
echo "=== android dir ==="
|
|
ls -la android | sed -n '1,200p'
|
|
echo "=== android/app dir ==="
|
|
ls -la android/app | sed -n '1,200p'
|
|
echo "--- root key.properties ---"
|
|
cat key.properties || true
|
|
echo "--- android/key.properties ---"
|
|
cat android/key.properties || true
|
|
env:
|
|
RELEASE_KEYSTORE_BASE64: ${{ secrets.INVENTREE_RELEASE_KEY_BASE64 }}
|
|
STORE_PASSWORD: ${{ secrets.INVENTREE_STORE_PASSWORD }}
|
|
KEY_PASSWORD: ${{ secrets.INVENTREE_KEY_PASSWORD }}
|
|
KEY_ALIAS: ${{ secrets.INVENTREE_KEY_ALIAS }}
|
|
|
|
- name: Build Release APK
|
|
uses: ./.github/actions/nix-devshell
|
|
with:
|
|
commands: |
|
|
flutter build apk --release --no-tree-shake-icons
|
|
|
|
- name: Upload Release APK artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: app-release-apk
|
|
path: build/app/outputs/flutter-apk/*.apk
|
|
# retention-days: 90
|