1- name : Build Android App Release
1+ name : Android Modal (production) deploy
22
33on :
44 workflow_dispatch :
1111jobs :
1212 build_with_signing :
1313 name : Build Android App Release
14- runs-on : macos-latest
14+ runs-on : macos-latest-xlarge
1515
1616 steps :
1717 # Checkout the repo
1818 - name : Checkout repository
1919 uses : actions/checkout@v4
20+
21+ # Create temp firebase key
2022 - name : Create temp firebase key
2123 env :
2224 FIREBASE_KEY_BASE64 : ${{ secrets.FIREBASE_KEY_BASE64 }}
2628
2729 # import certificate and provisioning profile from secrets
2830 echo -n "$FIREBASE_KEY_BASE64" | base64 --decode -o $FIREBASE_KEY_PATH
31+
2932 # Setup Java 11
3033 - name : Setup Java 17
3134 uses : actions/setup-java@v3
3437 java-version : ' 17'
3538 architecture : x86_64
3639 cache : ' gradle'
40+
41+ # Cache Gradle
3742 - name : Cache Gradle
3843 uses : actions/cache@v3
3944 with :
@@ -43,36 +48,26 @@ jobs:
4348 key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
4449 restore-keys : |
4550 ${{ runner.os }}-gradle-
46- # Install Flutter SDK
47- - name : Install Flutter
48- uses : subosito/flutter-action@v2
51+
52+ # Install Flutter and Dependencies
53+ - uses : ./.github/actions/dependencies
4954 with :
50- flutter-version : ' 3.19.5'
51- # Get package dependencies and generate files
52- - name : Get package dependencies and generate files
53- run : |
54- flutter pub get
55- flutter pub run build_runner build --delete-conflicting-outputs
56- # Get example app dependencies and generate files
57- - name : Get example app dependencies and generate files
58- working-directory : example
59- run : |
60- flutter pub get
61- flutter pub run build_runner build --delete-conflicting-outputs
55+ working-directory : packages/reown_appkit/example/modal
56+
6257 # Build Android example app
6358 - name : Build Android APK
64- working-directory : example
59+ working-directory : packages/reown_appkit/ example/modal
6560 env :
6661 PROJECT_ID : ${{ secrets.PROJECT_ID }}
6762 APPKIT_AUTH : ${{ secrets.APPKIT_AUTH }}
6863 APPKIT_PROJECT_ID : ${{ secrets.APPKIT_PROJECT_ID }}
6964 AUTH_SERVICE_URL : ${{ secrets.AUTH_SERVICE_URL }}
7065 run : |
7166 # Get app version from file
67+ # VERSION_FILE=$GITHUB_WORKSPACE/lib/version.dart
68+ # VERSION=`echo $(cat $VERSION_FILE) | sed "s/[^']*'\([^']*\)'.*/\1/"`
69+ VERSION=4.0.0
7270 GRADLE_FILE=android/gradle.properties
73- VERSION_FILE=$GITHUB_WORKSPACE/lib/version.dart
74-
75- VERSION=`echo $(cat $VERSION_FILE) | sed "s/[^']*'\([^']*\)'.*/\1/"`
7671
7772 # Set versionName on gradle.properties
7873 awk -F"=" -v newval="$VERSION" 'BEGIN{OFS=FS} $1=="versionName"{$2=newval}1' $GRADLE_FILE > "$GRADLE_FILE.tmp" && mv "$GRADLE_FILE.tmp" $GRADLE_FILE
@@ -89,18 +84,23 @@ jobs:
8984 # Setup Node
9085 - name : Setup Node
9186 uses : actions/setup-node@v3
87+
9288 # Setup Firebase
9389 - name : Setup Firebase
9490 uses : w9jds/setup-firebase@main
9591 with :
9692 tools-version : 13.0.1
9793 firebase_token : ${{ secrets.FIREBASE_TOKEN }}
94+
95+ # Upload APK
9896 - name : Upload APK
99- working-directory : example/build/app/outputs/flutter-apk
97+ working-directory : packages/reown_appkit/ example/modal /build/app/outputs/flutter-apk
10098 env :
10199 APP_ID : ${{ secrets.ANDROID_APP_ID }}
102100 run : |
103- firebase appdistribution:distribute app-stable-release.apk --app $APP_ID --release-notes "Web3Modal Flutter stable release" --groups "flutter-team, javascript-team, kotlin-team"
101+ firebase appdistribution:distribute app-stable-release.apk --app $APP_ID --release-notes "AppKit Flutter sample production" --groups "flutter-team, javascript-team, kotlin-team"
102+
103+ # Notify Channel
104104 - name : Notify Channel
105105 uses : slackapi/slack-github-action@v1.24.0
106106 env :
@@ -109,7 +109,7 @@ jobs:
109109 with :
110110 payload : |-
111111 {
112- "text":"🤖 New *Android* build *${{ github.ref_name }}* stable version for *Web3Modal Flutter * was just deployed. Test at https://appdistribution.firebase.dev/i/a8efff56e3f0fdb0"
112+ "text":"🤖 AppKit *Modal* Flutter Sample *${{ github.ref_name }}* was just deployed. Test at https://appdistribution.firebase.dev/i/a8efff56e3f0fdb0"
113113 }
114114
115115 # Clean up Flutter envs
@@ -119,4 +119,8 @@ jobs:
119119 rm $RUNNER_TEMP/flutter-c7c2c-6df892fe6ddb.json
120120 flutter clean
121121 cd example
122- flutter clean
122+ flutter clean
123+
124+ # Launch locally
125+ # Needs docker to be running
126+ # act -j build_with_signing --container-architecture linux/amd64 -P macos-latest-xlarge=-self-hosted --secret-file .github/workflows/.env.secret.modal -W .github/workflows/release_modal_android.yml
0 commit comments