@@ -2,14 +2,31 @@ name: build_nightly
22
33on :
44 push :
5- branches :
6- - develop
5+ # branches:
6+ # - develop
77 workflow_dispatch :
8+ inputs :
9+ build_ios :
10+ type : boolean
11+ description : iOS
12+ default : true
13+ build_android :
14+ type : boolean
15+ description : Android
16+ default : true
17+ build_web :
18+ type : boolean
19+ description : Web
20+ default : true
821
922defaults :
1023 run :
1124 working-directory : sample_app
1225
26+ env :
27+ FLUTTER_VERSION : " 3.29.0"
28+ FLUTTER_CHANNEL : stable
29+
1330concurrency :
1431 group : ${{ github.workflow }}-${{ github.ref }}
1532 cancel-in-progress : true
@@ -18,14 +35,22 @@ jobs:
1835 build_and_deploy_ios :
1936 runs-on : macos-latest
2037 timeout-minutes : 40
38+ if : ${{ github.event_name == 'push' || inputs.build_ios == true }}
39+ # if: false
2140 steps :
41+ - name : Install Bot SSH Key
42+ uses :
webfactory/[email protected] 43+ with :
44+ ssh-private-key : ${{ secrets.BOT_SSH_PRIVATE_KEY }}
45+
2246 - name : Checkout code
2347 uses : actions/checkout@v3
2448
2549 - name : Setup Flutter
2650 uses : subosito/flutter-action@v2
2751 with :
28- channel : stable
52+ channel : ${{ env.FLUTTER_CHANNEL }}
53+ flutter-version : ${{ env.FLUTTER_VERSION }}
2954 cache : true
3055
3156 - name : Setup Ruby and Gems
@@ -39,13 +64,13 @@ jobs:
3964
4065 - name : Copy google service account
4166 run : |
42- echo "${{ secrets.SAMPLE_FIREBASE_UPLOAD_CREDENTIALS }}" > ${{GITHUB_WORKSPACE}} /firebase-service-account.json
67+ echo "${{ secrets.SAMPLE_FIREBASE_UPLOAD_CREDENTIALS }}" | base64 --decode | jq > ${{ github.workspace }}/sample_app/ios /firebase-service-account.json
4368
4469 - name : Build and release
4570 env :
71+ GOOGLE_APPLICATION_CREDENTIALS : " ${{ github.workspace }}/sample_app/ios/firebase-service-account.json"
4672 MATCH_PASSWORD : ${{ secrets.MATCH_PASSWORD }}
47- MATCH_GIT_BASIC_AUTHORIZATION : ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
48- GOOGLE_APPLICATION_CREDENTIALS : ${{GITHUB_WORKSPACE}}/firebase-service-account.json
73+ APPSTORE_API_KEY : ${{ secrets.APPSTORE_API_KEY }}
4974 run : |
5075 flutter build ios --no-codesign
5176 cd ios
@@ -54,42 +79,56 @@ jobs:
5479 build_and_deploy_android :
5580 runs-on : ubuntu-latest
5681 timeout-minutes : 15
82+ if : ${{ github.event_name == 'push' || inputs.build_android == true }}
5783 steps :
84+ - name : Install Bot SSH Key
85+ uses :
webfactory/[email protected] 86+ with :
87+ ssh-private-key : ${{ secrets.BOT_SSH_PRIVATE_KEY }}
88+
5889 - name : Checkout code
5990 uses : actions/checkout@v3
6091
6192 - name : Setup Java
6293 uses : actions/setup-java@v1
6394 with :
64- java-version : ' 12.x'
95+ distribution : " zulu"
96+ java-version : " 17"
6597
6698 - name : Setup Flutter
6799 uses : subosito/flutter-action@v2
68100 with :
69- channel : stable
101+ channel : ${{ env.FLUTTER_CHANNEL }}
102+ flutter-version : ${{ env.FLUTTER_VERSION }}
70103 cache : true
71104
72105 - name : Build
73106 run : flutter build apk
74107
108+ - name : Copy google service account
109+ run : |
110+ echo "${{ secrets.SAMPLE_FIREBASE_UPLOAD_CREDENTIALS }}" | base64 --decode | jq > ${{ github.workspace }}/sample_app/android/firebase-service-account.json
111+
75112 - name : Deploy
76113 uses : wzieba/Firebase-Distribution-Github-Action@v1
77114 with :
78115 appId : ${{secrets.SAMPLE_FIREBASE_ANDROID_APPID}}
79- serviceCredentialsFileContent : ${{secrets.SAMPLE_FIREBASE_UPLOAD_CREDENTIALS}}
116+ serviceCredentialsFile : " ${{ github.workspace }}/sample_app/android/firebase-service-account.json "
80117 groups : stream-testers
81118 debug : true
82- file : sample_app/build/app/outputs/apk/release/ app-release.apk
119+ file : " ${{ github.workspace }}/ sample_app/build/app/outputs/flutter- apk/app-release.apk"
83120
84121 - name : Upload APK
85- uses : actions/upload-artifact@v3
122+ uses : actions/upload-artifact@v4
86123 with :
87124 name : android-stream-chat-v1
88- path : sample_app/build/app/outputs/apk/release/ app-release.apk
125+ path : " ${{ github.workspace }}/ sample_app/build/app/outputs/flutter- apk/app-release.apk"
89126
90127 build_and_deploy_web :
91128 runs-on : ubuntu-latest
92129 timeout-minutes : 10
130+ # if: ${{ github.event_name == 'push' || inputs.build_web == true }}
131+ if : false
93132 steps :
94133 - name : Checkout code
95134 uses : actions/checkout@v3
@@ -103,14 +142,14 @@ jobs:
103142 - name : Setup Flutter
104143 uses : subosito/flutter-action@v2
105144 with :
106- channel : stable
145+ channel : ${{ env.FLUTTER_CHANNEL }}
146+ flutter-version : ${{ env.FLUTTER_VERSION }}
107147 cache : true
108- flutter-version : 3.29.0
109148
110149 - name : Build and Deploy
111- uses : bluefireteam/flutter-gh-pages@v7
150+ uses : bluefireteam/flutter-gh-pages@v9
112151 with :
113- baseHref : /flutter-samples /
152+ baseHref : /stream-chat-flutter /
114153 workingDir : sample_app
115154
116155
0 commit comments