1+ name : " Publish"
2+ on :
3+ workflow_dispatch :
4+ jobs :
5+ publish-android :
6+ runs-on : ubuntu-latest
7+ steps :
8+ - name : ⬇️ Checkout repository
9+ uses : actions/checkout@v3
10+ - name : ⚙️ Setup Java
11+ uses : actions/setup-java@v3
12+ with :
13+ java-version : ' 12.x'
14+ distribution : ' adopt'
15+ cache : ' gradle'
16+ - name : ⚙️ Setup Flutter
17+ uses : subosito/flutter-action@v2
18+ with :
19+ channel : ' stable'
20+ cache : true
21+ cache-key : ' flutter-:os:-:channel:-:version:-:arch:-:hash:'
22+ cache-path : ' ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:'
23+ architecture : x64
24+ - name : 🔐 Retrieve base64 keystore and decode it to a file
25+ env :
26+ KEYSTORE_BASE64 : ${{ secrets.ANDROID_SIGNING_KEY }}
27+ run : echo $KEYSTORE_BASE64 | base64 --decode > "${{ 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
36+ # This is seems to be only needed when running github actions locally with act
37+ # - run: git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.13.0-x64
38+ - run : flutter pub get
39+ # There are many issues currently that first need to be fixed to allow this rule
40+ # - 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
45+ - name : ⬆️ Github Release
46+ uses : softprops/action-gh-release@v1
47+ with :
48+ draft : true
49+ files : ${{ github.workspace }}/build/app/outputs/apk/release/app-release.apk
0 commit comments