From a2e8d1b59cc49695b6861bdb1f9b66e406e70499 Mon Sep 17 00:00:00 2001 From: Brandon Berhent Date: Fri, 4 Sep 2020 10:46:48 -0400 Subject: [PATCH] Add android release workflow --- .github/workflows/deploy_release_android.yml | 110 +++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 .github/workflows/deploy_release_android.yml diff --git a/.github/workflows/deploy_release_android.yml b/.github/workflows/deploy_release_android.yml new file mode 100644 index 00000000..255476e4 --- /dev/null +++ b/.github/workflows/deploy_release_android.yml @@ -0,0 +1,110 @@ +name: DEPLOY_RELEASE + +on: + push: + tags: + - 'v*-release-android' + +jobs: + build_ed25519: + name: Build dependent library + runs-on: self-hosted + steps: + - uses: actions/checkout@master + with: + repository: appditto/flutter_nano_ffi + ref: refs/heads/master + - name: Run cmake + working-directory: android + run: | + cmake . + make + - name: Upload artifact + if: success() + uses: actions/upload-artifact@v1 + with: + name: libraries + path: android/libed25519_blake2b.dylib + + run_tests: + name: Run tests + needs: build_ed25519 + runs-on: self-hosted + steps: + - uses: actions/checkout@master + - name: Download library + uses: actions/download-artifact@v2 + + - name: Set workspace in env + run: echo ::set-env name=workspace::$GITHUB_WORKSPACE + + - name: Run tests + env: + ED215519_SO_FILE: ${{ env.workspace }}/libraries/libed25519_blake2b.dylib + run: | + flutter pub get + flutter test + + build_android: + name: Build android app + needs: run_tests + runs-on: self-hosted + steps: + - uses: actions/checkout@master + + - name: Build artifacts + working-directory: android + env: + ED215519_SO_FILE: /Users/adapps/flutter_nano_ffi/android/libed25519_blake2b.dylib + FLUTTER_PATH: /Users/adapps/flutter + ANDROID_SDK_PATH: /Users/adapps/Library/Android/Sdk + GEM_HOME: ~/.gems + run: | + echo "::add-path::~/.gems/bin" + echo flutter.sdk=${{ env.FLUTTER_PATH }} > local.properties + echo sdk.dir=${{ env.ANDROID_SDK_PATH }} >> local.properties + echo flutter.buildMode=release >> local.properties + echo storeFile=${{ secrets.ANDROID_KEYSTORE_PATH }} > key.properties + echo keyAlias=${{ secrets.ANDROID_KEY_ALIAS }} >> key.properties + echo keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }} >> key.properties + echo storePassword=${{ secrets.ANDROID_KEY_STORE_PASSWORD }} >> key.properties + fastlane build_android production:true + rm -f key.properties + + - name: Upload APK + if: success() + uses: actions/upload-artifact@v1 + with: + name: android-apk + path: build/app/outputs/apk/release/app-release.apk + + - name: Upload Bundle + if: success() + uses: actions/upload-artifact@v1 + with: + name: android-aab + path: build/app/outputs/bundle/release/app-release.aab + + deploy_android: + name: Deploy android production + needs: build_android + runs-on: self-hosted + steps: + - uses: actions/checkout@master + - name: Download AAB + uses: actions/download-artifact@v2 + with: + name: android-aab + + - name: Set workspace in env + run: echo ::set-env name=workspace::$GITHUB_WORKSPACE + + - name: Deploy android + if: success() + working-directory: android + env: + AAB_PATH: ${{ env.workspace }}/app-release.aab + GEM_HOME: ~/.gems + run: | + echo "::add-path::~/.gems/bin" + fastlane deploy_android production:true \ No newline at end of file