Build Android #71
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Android | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push events but only for the "main" branch | |
# push: | |
# branches: [ "main" ] | |
# pull_request: | |
# branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macOS-latest | |
steps: | |
- name: Android cache | |
id: android-cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.android/debug.keystore | |
key: debug.keystore | |
- uses: actions/checkout@v3 | |
with: | |
path: 'cbreez' | |
- name: copy-config | |
env: | |
GOOGLE_SERVICES: ${{secrets.GOOGLE_SERVICES}} | |
run: | | |
cd cbreez | |
echo "$GOOGLE_SERVICES" > android/app/google-services.json | |
- uses: actions/checkout@v3 | |
with: | |
repository: 'breez/breez-sdk' | |
ssh-key: ${{secrets.REPO_SSH_KEY}} | |
path: 'breez-sdk' | |
# Setup the flutter environment. | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.7.12' | |
channel: 'stable' | |
- name: install dependencies | |
run: | | |
cargo install [email protected] | |
brew install protobuf | |
cd breez-sdk/libs/sdk-flutter | |
make init | |
cd ../sdk-core | |
make init | |
- name: build sdk | |
env: | |
SSH_PRIVATE_KEY: ${{secrets.REPO_SSH_KEY}} | |
run: | | |
mkdir -p ~/.ssh | |
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa | |
sudo chmod 600 ~/.ssh/id_rsa | |
ssh-add ~/.ssh/id_rsa | |
cd breez-sdk/libs/sdk-flutter | |
make android | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: flutter-doctor | |
run: | | |
cd cbreez | |
flutter doctor | |
- name: pub-get | |
run: | | |
cd cbreez | |
flutter pub get | |
- name: dart-analyze | |
run: | | |
cd cbreez | |
dart analyze --fatal-infos | |
- name: run-tests | |
run: | | |
cd cbreez | |
flutter test | |
- name: override-config | |
env: | |
CONFIG_FILE: ${{secrets.CONFIG_FILE}} | |
run: | | |
echo "$CONFIG_FILE" > ./cbreez/config.json | |
- name: build-apk | |
run: | | |
cd cbreez | |
flutter build apk --split-per-abi --dart-define-from-file=config.json | |
- name: Upload apk | |
uses: actions/upload-artifact@v3 | |
with: | |
name: c-breez | |
path: cbreez/build/app/outputs/flutter-apk/app-*.apk |