mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-04-22 03:26:11 +02:00
76 lines
1.8 KiB
YAML
76 lines
1.8 KiB
YAML
name: Android Build
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-android:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '17'
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.21'
|
|
cache-dependency-path: go_backend/go.sum
|
|
|
|
- name: Install Android SDK & NDK
|
|
uses: android-actions/setup-android@v3
|
|
|
|
- name: Install gomobile
|
|
run: |
|
|
go install golang.org/x/mobile/cmd/gomobile@latest
|
|
gomobile init
|
|
|
|
- name: Build Go backend for Android
|
|
working-directory: go_backend
|
|
run: |
|
|
mkdir -p ../android/app/libs
|
|
gomobile bind -target=android -androidapi 24 -o ../android/app/libs/gobackend.aar .
|
|
env:
|
|
CGO_ENABLED: 1
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: 'stable'
|
|
cache: true
|
|
|
|
- name: Get Flutter dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Generate app icons
|
|
run: dart run flutter_launcher_icons
|
|
|
|
- name: Build APK (Release)
|
|
run: flutter build apk --release
|
|
|
|
- name: Build App Bundle (Release)
|
|
run: flutter build appbundle --release
|
|
|
|
- name: Upload APK artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: SpotiFLAC-Android-APK
|
|
path: build/app/outputs/flutter-apk/app-release.apk
|
|
retention-days: 30
|
|
|
|
- name: Upload AAB artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: SpotiFLAC-Android-AAB
|
|
path: build/app/outputs/bundle/release/app-release.aab
|
|
retention-days: 30
|