@@ -21,29 +21,69 @@ jobs:
2121 cache-key : ' flutter-:os:-:channel:-:version:-:arch:-:hash:'
2222 cache-path : ' ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:'
2323 architecture : x64
24- - name : 🔐 Retrieve base64 keystore and decode it to a file
25- env :
26- KEYSTORE_BASE64 : ${{ secrets.ANDROID_SIGNING_KEY }}
27- run : sudo bash -c 'base64 --decode <<< "$KEYSTORE_BASE64" > ${{ github.workspace }}/android/app/key.jks'
28- - name : 📝🔐 Create keystore.properties file
29- env :
30- KEYSTORE_PROPERTIES_PATH : ${{ github.workspace }}/android/key.properties
31- run : |
32- echo '${{ inputs.flavor }}StoreFile=key.jks' > $KEYSTORE_PROPERTIES_PATH
33- echo '${{ inputs.flavor }}KeyAlias=${{ secrets.ANDROID_KEY_ALIAS }}' >> $KEYSTORE_PROPERTIES_PATH
34- echo '${{ inputs.flavor }}StorePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH
35- echo '${{ inputs.flavor }}KeyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH
3624# This is seems to be only needed when running github actions locally with act
3725# - run: git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.13.0-x64
38- - run : flutter pub get
26+ - name : 📥 Downloading Dependencies
27+ run : flutter pub get
3928# There are many issues currently that first need to be fixed to allow this rule
4029# - run: flutter analyze --fatal-infos ./
41- - run : dart format -o show --set-exit-if-changed ./
42- - run : flutter test
43- - run : flutter build apk
44- - run : flutter build appbundle
30+ - name : 📝 Format
31+ run : dart format -o none --set-exit-if-changed ./
32+ - name : 🧪 Testing
33+ run : flutter test
34+ - name : 🛠️ Build APK
35+ run : flutter build apk
36+ - name : 🛠️ Build AppBundle
37+ run : flutter build appbundle
38+ - name : 🔐 Sign app APK
39+ uses : r0adkll/sign-android-release@v1
40+ id : sign_app_apk
41+ with :
42+ releaseDirectory : ${{ github.workspace }}/build/app/outputs/apk/release
43+ signingKeyBase64 : ${{ secrets.ANDROID_SIGNING_KEY }}
44+ alias : ${{ secrets.ANDROID_KEY_ALIAS }}
45+ keyStorePassword : ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
46+ keyPassword : ${{ secrets.ANDROID_KEY_PASSWORD }}
47+ - name : 🔐 Sign app AAB
48+ uses : r0adkll/sign-android-release@v1
49+ id : sign_app_aab
50+ with :
51+ releaseDirectory : ${{ github.workspace }}/build/app/outputs/bundle/release
52+ signingKeyBase64 : ${{ secrets.ANDROID_SIGNING_KEY }}
53+ alias : ${{ secrets.ANDROID_KEY_ALIAS }}
54+ keyStorePassword : ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
55+ keyPassword : ${{ secrets.ANDROID_KEY_PASSWORD }}
56+ - name : 🗃️ Rename the Release File
57+ run : cp ${{ steps.sign_app_apk.outputs.signedReleaseFile }} ${{ github.workspace }}/app-release.apk
58+ - name : 📄 Extract Version Number
59+ id : flutter-version
60+ uses : NiklasLehnfeld/flutter-version-number-action@main
61+ with :
62+ file-path : ${{ github.workspace }}/pubspec.yaml
63+ - name : ✂️ Split Version Number
64+ uses : jungwinter/split@v1
65+ id : flutter-version-split
66+ with :
67+ msg : ${{ steps.flutter-version.outputs.version-number }}
68+ seperator : ' +'
4569 - name : ⬆️ Github Release
4670 uses : softprops/action-gh-release@v1
4771 with :
72+ name : ${{ steps.flutter-version-split.outputs._0 }}
73+ tag_name : ${{ steps.flutter-version-split.outputs._0 }}
74+ body_path : ${{ github.workspace }}/fastlane/metadata/android/en-US/changelogs/${{ steps.flutter-version-split.outputs._1 }}.txt
4875 draft : true
49- files : ${{ github.workspace }}/build/app/outputs/apk/release/app-release.apk
76+ files : " ${{ github.workspace }}/app-release.apk"
77+ fail_on_unmatched_files : true
78+ # Prepared for the Automatic Upload to Google Play Store
79+ # - name: 🚀 Upload Release to Google Play Store
80+ # uses: r0adkll/upload-google-play@v1
81+ # with:
82+ # serviceAccountJsonPlainText: ${{ SERVICE_ACCOUNT_JSON }}
83+ # packageName: com.example.MyApp
84+ # releaseFiles: app/build/outputs/bundle/release/app-release.aab
85+ # track: production
86+ # status: inProgress
87+ # whatsNewDirectory: distribution/whatsnew
88+ # mappingFile: app/build/outputs/mapping/release/mapping.txt
89+ # debugSymbols: app/intermediates/merged_native_libs/release/out/lib
0 commit comments