Skip to content

Commit 1b810d8

Browse files
committed
fix build run
1 parent d188172 commit 1b810d8

File tree

4 files changed

+59
-19
lines changed

4 files changed

+59
-19
lines changed

.github/workflows/build_nightly.yml

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,31 @@ name: build_nightly
22

33
on:
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

922
defaults:
1023
run:
1124
working-directory: sample_app
1225

26+
env:
27+
FLUTTER_VERSION: "3.29.0"
28+
FLUTTER_CHANNEL: stable
29+
1330
concurrency:
1431
group: ${{ github.workflow }}-${{ github.ref }}
1532
cancel-in-progress: true
@@ -18,14 +35,21 @@ 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 }}
2139
steps:
40+
- name: Install Bot SSH Key
41+
uses: webfactory/[email protected]
42+
with:
43+
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
44+
2245
- name: Checkout code
2346
uses: actions/checkout@v3
2447

2548
- name: Setup Flutter
2649
uses: subosito/flutter-action@v2
2750
with:
28-
channel: stable
51+
channel: ${{ env.FLUTTER_CHANNEL }}
52+
flutter-version: ${{ env.FLUTTER_VERSION }}
2953
cache: true
3054

3155
- name: Setup Ruby and Gems
@@ -39,13 +63,12 @@ jobs:
3963

4064
- name: Copy google service account
4165
run: |
42-
echo "${{ secrets.SAMPLE_FIREBASE_UPLOAD_CREDENTIALS }}" > ${{GITHUB_WORKSPACE}}/firebase-service-account.json
66+
echo "${{ secrets.SAMPLE_FIREBASE_UPLOAD_CREDENTIALS }}" | base64 --decode | jq > ios/firebase-service-account.json
4367
4468
- name: Build and release
4569
env:
70+
GOOGLE_APPLICATION_CREDENTIALS: firebase-service-account.json
4671
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
4972
run: |
5073
flutter build ios --no-codesign
5174
cd ios
@@ -54,42 +77,56 @@ jobs:
5477
build_and_deploy_android:
5578
runs-on: ubuntu-latest
5679
timeout-minutes: 15
80+
if: ${{ github.event_name == 'push' || inputs.build_android == true }}
5781
steps:
82+
- name: Install Bot SSH Key
83+
uses: webfactory/[email protected]
84+
with:
85+
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
86+
5887
- name: Checkout code
5988
uses: actions/checkout@v3
6089

6190
- name: Setup Java
6291
uses: actions/setup-java@v1
6392
with:
64-
java-version: '12.x'
93+
distribution: "zulu"
94+
java-version: "17"
6595

6696
- name: Setup Flutter
6797
uses: subosito/flutter-action@v2
6898
with:
69-
channel: stable
99+
channel: ${{ env.FLUTTER_CHANNEL }}
100+
flutter-version: ${{ env.FLUTTER_VERSION }}
70101
cache: true
71102

72103
- name: Build
73104
run: flutter build apk
74105

106+
- name: Copy google service account
107+
run: |
108+
echo "${{ secrets.SAMPLE_FIREBASE_UPLOAD_CREDENTIALS }}" | base64 --decode | jq > android/firebase-service-account.json
109+
75110
- name: Deploy
76111
uses: wzieba/Firebase-Distribution-Github-Action@v1
77112
with:
78113
appId: ${{secrets.SAMPLE_FIREBASE_ANDROID_APPID}}
79-
serviceCredentialsFileContent: ${{secrets.SAMPLE_FIREBASE_UPLOAD_CREDENTIALS}}
114+
serviceCredentialsFile: android/firebase-service-account.json
80115
groups: stream-testers
81116
debug: true
82-
file: sample_app/build/app/outputs/apk/release/app-release.apk
117+
file: build/app/outputs/apk/release/app-release.apk
83118

84119
- name: Upload APK
85-
uses: actions/upload-artifact@v3
120+
uses: actions/upload-artifact@v4
86121
with:
87122
name: android-stream-chat-v1
88-
path: sample_app/build/app/outputs/apk/release/app-release.apk
123+
path: build/app/outputs/apk/release/app-release.apk
89124

90125
build_and_deploy_web:
91126
runs-on: ubuntu-latest
92127
timeout-minutes: 10
128+
# if: ${{ github.event_name == 'push' || inputs.build_web == true }}
129+
if: false
93130
steps:
94131
- name: Checkout code
95132
uses: actions/checkout@v3
@@ -103,14 +140,14 @@ jobs:
103140
- name: Setup Flutter
104141
uses: subosito/flutter-action@v2
105142
with:
106-
channel: stable
143+
channel: ${{ env.FLUTTER_CHANNEL }}
144+
flutter-version: ${{ env.FLUTTER_VERSION }}
107145
cache: true
108-
flutter-version: 3.29.0
109146

110147
- name: Build and Deploy
111-
uses: bluefireteam/flutter-gh-pages@v7
148+
uses: bluefireteam/flutter-gh-pages@v9
112149
with:
113-
baseHref: /flutter-samples/
150+
baseHref: /stream-chat-flutter/
114151
workingDir: sample_app
115152

116153

sample_app/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ android {
4242
defaultConfig {
4343
applicationId "io.getstream.chat.android.flutter.sample"
4444
minSdkVersion 23
45-
targetSdkVersion 34
45+
targetSdkVersion 35
4646
versionCode flutterVersionCode.toInteger()
4747
versionName flutterVersionName
4848
multiDexEnabled true

sample_app/android/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ subprojects {
1616
def packageName = manifest.@package.text()
1717
android.namespace= packageName
1818
}
19+
if (project.hasProperty('android')) {
20+
project.android { compileSdkVersion 35 }
21+
}
1922
}
2023

2124
}
@@ -25,4 +28,4 @@ subprojects {
2528

2629
tasks.register("clean", Delete) {
2730
delete rootProject.buildDir
28-
}
31+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx2g
22
android.enableR8=true
33
android.useAndroidX=true
44
android.enableJetifier=true

0 commit comments

Comments
 (0)