@@ -2,14 +2,31 @@ name: build_nightly
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - develop
5
+ # branches:
6
+ # - develop
7
7
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
8
21
9
22
defaults :
10
23
run :
11
24
working-directory : sample_app
12
25
26
+ env :
27
+ FLUTTER_VERSION : " 3.29.0"
28
+ FLUTTER_CHANNEL : stable
29
+
13
30
concurrency :
14
31
group : ${{ github.workflow }}-${{ github.ref }}
15
32
cancel-in-progress : true
@@ -18,14 +35,22 @@ jobs:
18
35
build_and_deploy_ios :
19
36
runs-on : macos-latest
20
37
timeout-minutes : 40
38
+ if : ${{ github.event_name == 'push' || inputs.build_ios == true }}
39
+ # if: false
21
40
steps :
41
+ - name : Install Bot SSH Key
42
+ uses :
webfactory/[email protected]
43
+ with :
44
+ ssh-private-key : ${{ secrets.BOT_SSH_PRIVATE_KEY }}
45
+
22
46
- name : Checkout code
23
47
uses : actions/checkout@v3
24
48
25
49
- name : Setup Flutter
26
50
uses : subosito/flutter-action@v2
27
51
with :
28
- channel : stable
52
+ channel : ${{ env.FLUTTER_CHANNEL }}
53
+ flutter-version : ${{ env.FLUTTER_VERSION }}
29
54
cache : true
30
55
31
56
- name : Setup Ruby and Gems
@@ -39,13 +64,13 @@ jobs:
39
64
40
65
- name : Copy google service account
41
66
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
43
68
44
69
- name : Build and release
45
70
env :
71
+ GOOGLE_APPLICATION_CREDENTIALS : " ${{ github.workspace }}/sample_app/ios/firebase-service-account.json"
46
72
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 }}
49
74
run : |
50
75
flutter build ios --no-codesign
51
76
cd ios
@@ -54,42 +79,56 @@ jobs:
54
79
build_and_deploy_android :
55
80
runs-on : ubuntu-latest
56
81
timeout-minutes : 15
82
+ if : ${{ github.event_name == 'push' || inputs.build_android == true }}
57
83
steps :
84
+ - name : Install Bot SSH Key
85
+ uses :
webfactory/[email protected]
86
+ with :
87
+ ssh-private-key : ${{ secrets.BOT_SSH_PRIVATE_KEY }}
88
+
58
89
- name : Checkout code
59
90
uses : actions/checkout@v3
60
91
61
92
- name : Setup Java
62
93
uses : actions/setup-java@v1
63
94
with :
64
- java-version : ' 12.x'
95
+ distribution : " zulu"
96
+ java-version : " 17"
65
97
66
98
- name : Setup Flutter
67
99
uses : subosito/flutter-action@v2
68
100
with :
69
- channel : stable
101
+ channel : ${{ env.FLUTTER_CHANNEL }}
102
+ flutter-version : ${{ env.FLUTTER_VERSION }}
70
103
cache : true
71
104
72
105
- name : Build
73
106
run : flutter build apk
74
107
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
+
75
112
- name : Deploy
76
113
uses : wzieba/Firebase-Distribution-Github-Action@v1
77
114
with :
78
115
appId : ${{secrets.SAMPLE_FIREBASE_ANDROID_APPID}}
79
- serviceCredentialsFileContent : ${{secrets.SAMPLE_FIREBASE_UPLOAD_CREDENTIALS}}
116
+ serviceCredentialsFile : " ${{ github.workspace }}/sample_app/android/firebase-service-account.json "
80
117
groups : stream-testers
81
118
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"
83
120
84
121
- name : Upload APK
85
- uses : actions/upload-artifact@v3
122
+ uses : actions/upload-artifact@v4
86
123
with :
87
124
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"
89
126
90
127
build_and_deploy_web :
91
128
runs-on : ubuntu-latest
92
129
timeout-minutes : 10
130
+ # if: ${{ github.event_name == 'push' || inputs.build_web == true }}
131
+ if : false
93
132
steps :
94
133
- name : Checkout code
95
134
uses : actions/checkout@v3
@@ -103,14 +142,14 @@ jobs:
103
142
- name : Setup Flutter
104
143
uses : subosito/flutter-action@v2
105
144
with :
106
- channel : stable
145
+ channel : ${{ env.FLUTTER_CHANNEL }}
146
+ flutter-version : ${{ env.FLUTTER_VERSION }}
107
147
cache : true
108
- flutter-version : 3.29.0
109
148
110
149
- name : Build and Deploy
111
- uses : bluefireteam/flutter-gh-pages@v7
150
+ uses : bluefireteam/flutter-gh-pages@v9
112
151
with :
113
- baseHref : /flutter-samples /
152
+ baseHref : /stream-chat-flutter /
114
153
workingDir : sample_app
115
154
116
155
0 commit comments