diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml new file mode 100644 index 00000000..232eab64 --- /dev/null +++ b/.github/workflows/android-release.yml @@ -0,0 +1,58 @@ +name: Google Play release +on: + push: + branches: [ master ] + +jobs: + deploy_android: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 12.x + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + + - name: Decrypt config files + run: cd ./android/fastlane/envfiles && chmod +x ./decrypt_secrets.sh && ./decrypt_secrets.sh + env: + DECRYPTKEY_PLAYSTORE: ${{ secrets.DECRYPTKEY_PLAYSTORE }} + DECRYPTKEY_PLAYSTORE_SIGNING_KEY: ${{ secrets.DECRYPTKEY_PLAYSTORE_SIGNING_KEY }} + DECRYPTKEY_PROPERTIES: ${{ secrets.DECRYPTKEY_PROPERTIES }} + + - name: Setup Flutter + uses: subosito/flutter-action@v1 + with: + channel: 'stable' + + - name: Install Flutter dependencies + run: flutter pub get + + - name: Generated translation files + run: flutter gen-l10n + + - name: Build AAB + run: flutter build appbundle --release --no-sound-null-safety + env: + WGER_API_KEY: ${{ secrets.WGER_API_KEY }} + + - name: Run Fastlane + uses: maierj/fastlane-action@v2.0.0 + with: + lane: update_alpha + subdirectory: android + + # subdirectory: packages/smooth_app/android + # env: + # SIGN_STORE_PATH: ./../fastlane/envfiles/keystore.jks + # SIGN_STORE_PASSWORD: ${{ secrets.SIGN_STORE_PASSWORD }} + # SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }} + # SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }} + diff --git a/.gitignore b/.gitignore index f78f693b..8317ac5e 100644 --- a/.gitignore +++ b/.gitignore @@ -42,5 +42,6 @@ app.*.map.json # Exceptions to above rules. !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages -/android/fastlane/playstore.json -/android/app/wger.properties +/android/fastlane/envfiles/playstore.json +/android/fastlane/envfiles/wger.properties +/android/fastlane/envfiles/keys.jks diff --git a/android/.gitignore b/android/.gitignore index 0a741cb4..60658c9a 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -8,4 +8,4 @@ GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -key.properties +fastlane/envfiles/key.properties diff --git a/android/app/build.gradle b/android/app/build.gradle index 712fed18..30d91864 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -27,14 +27,14 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" // Keys for the android play store def keystoreProperties = new Properties() -def keystorePropertiesFile = rootProject.file('app/key.properties') +def keystorePropertiesFile = rootProject.file('fastlane/envfiles/key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } // Key for wger.de REST API def wgerProperties = new Properties() -def localMapsPropertiesFile = rootProject.file('app/wger.properties') +def localMapsPropertiesFile = rootProject.file('fastlane/envfiles/wger.properties') if (localMapsPropertiesFile.exists()) { project.logger.info('Load maps properties from local file') localMapsPropertiesFile.withReader('UTF-8') { reader -> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index cb64563b..413f6120 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -7,6 +7,12 @@ FlutterApplication and put your custom class here. --> + + + + - + diff --git a/pubspec.yaml b/pubspec.yaml index 4ce64429..da0c9b80 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.2.0+10 +version: 0.2.0+11 environment: sdk: '>=2.12.0 <3.0.0'