Skip to content

Commit 3be03dd

Browse files
committed
fix build run
1 parent d188172 commit 3be03dd

File tree

5 files changed

+113
-69
lines changed

5 files changed

+113
-69
lines changed

.github/workflows/build_nightly.yml

Lines changed: 54 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,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,12 @@ 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
4973
run: |
5074
flutter build ios --no-codesign
5175
cd ios
@@ -54,42 +78,56 @@ jobs:
5478
build_and_deploy_android:
5579
runs-on: ubuntu-latest
5680
timeout-minutes: 15
81+
if: ${{ github.event_name == 'push' || inputs.build_android == true }}
5782
steps:
83+
- name: Install Bot SSH Key
84+
uses: webfactory/[email protected]
85+
with:
86+
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
87+
5888
- name: Checkout code
5989
uses: actions/checkout@v3
6090

6191
- name: Setup Java
6292
uses: actions/setup-java@v1
6393
with:
64-
java-version: '12.x'
94+
distribution: "zulu"
95+
java-version: "17"
6596

6697
- name: Setup Flutter
6798
uses: subosito/flutter-action@v2
6899
with:
69-
channel: stable
100+
channel: ${{ env.FLUTTER_CHANNEL }}
101+
flutter-version: ${{ env.FLUTTER_VERSION }}
70102
cache: true
71103

72104
- name: Build
73105
run: flutter build apk
74106

107+
- name: Copy google service account
108+
run: |
109+
echo "${{ secrets.SAMPLE_FIREBASE_UPLOAD_CREDENTIALS }}" | base64 --decode | jq > ${{ github.workspace }}/sample_app/android/firebase-service-account.json
110+
75111
- name: Deploy
76112
uses: wzieba/Firebase-Distribution-Github-Action@v1
77113
with:
78114
appId: ${{secrets.SAMPLE_FIREBASE_ANDROID_APPID}}
79-
serviceCredentialsFileContent: ${{secrets.SAMPLE_FIREBASE_UPLOAD_CREDENTIALS}}
115+
serviceCredentialsFile: "${{ github.workspace }}/sample_app/android/firebase-service-account.json"
80116
groups: stream-testers
81117
debug: true
82-
file: sample_app/build/app/outputs/apk/release/app-release.apk
118+
file: build/app/outputs/flutter-apk/app-release.apk
83119

84120
- name: Upload APK
85-
uses: actions/upload-artifact@v3
121+
uses: actions/upload-artifact@v4
86122
with:
87123
name: android-stream-chat-v1
88-
path: sample_app/build/app/outputs/apk/release/app-release.apk
124+
path: build/app/outputs/flutter-apk/app-release.apk
89125

90126
build_and_deploy_web:
91127
runs-on: ubuntu-latest
92128
timeout-minutes: 10
129+
# if: ${{ github.event_name == 'push' || inputs.build_web == true }}
130+
if: false
93131
steps:
94132
- name: Checkout code
95133
uses: actions/checkout@v3
@@ -103,14 +141,14 @@ jobs:
103141
- name: Setup Flutter
104142
uses: subosito/flutter-action@v2
105143
with:
106-
channel: stable
144+
channel: ${{ env.FLUTTER_CHANNEL }}
145+
flutter-version: ${{ env.FLUTTER_VERSION }}
107146
cache: true
108-
flutter-version: 3.29.0
109147

110148
- name: Build and Deploy
111-
uses: bluefireteam/flutter-gh-pages@v7
149+
uses: bluefireteam/flutter-gh-pages@v9
112150
with:
113-
baseHref: /flutter-samples/
151+
baseHref: /stream-chat-flutter/
114152
workingDir: sample_app
115153

116154

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

sample_app/ios/fastlane/Fastfile

Lines changed: 53 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
fastlane_version "2.195.0"
21
default_platform :ios
32

43
before_all do
@@ -30,61 +29,65 @@ lane :match_appstore do
3029
)
3130
end
3231

33-
platform :ios do
34-
desc "Deploy build to Firebase"
35-
lane :deploy_to_firebase do
36-
match_me
37-
38-
gym(
39-
workspace: "./Runner.xcworkspace",
40-
scheme: "Runner",
41-
export_method: "ad-hoc",
42-
export_options: "./fastlane/beta_gym_export_options.plist",
43-
silent: true,
44-
clean: true,
45-
include_symbols: true,
46-
output_directory: "./dist"
47-
)
32+
lane :deploy_to_firebase do
33+
match_me
4834

49-
message = changelog_from_git_commits(commits_count: 10)
35+
gym(
36+
workspace: "./Runner.xcworkspace",
37+
scheme: "Runner",
38+
export_method: "ad-hoc",
39+
export_options: "./fastlane/beta_gym_export_options.plist",
40+
silent: true,
41+
clean: true,
42+
include_symbols: true,
43+
output_directory: "./dist"
44+
)
5045

51-
firebase_app_distribution(
52-
app: "1:674907137625:ios:cafb9fb076a453c4d7f348",
53-
groups: "ios-stream-testers"
54-
)
55-
end
46+
message = changelog_from_git_commits(commits_count: 10)
47+
48+
firebase_app_distribution(
49+
app: "1:674907137625:ios:cafb9fb076a453c4d7f348",
50+
groups: "ios-stream-testers"
51+
)
5652
end
5753

58-
platform :ios do
59-
desc "Deploy build to TestFlight"
60-
lane :deploy_to_testflight do
61-
match_appstore
54+
lane :deploy_to_testflight do
55+
match_appstore
56+
57+
settings_to_override = {
58+
:BUNDLE_IDENTIFIER => "io.getstream.flutter",
59+
:PROVISIONING_PROFILE_SPECIFIER => "match AppStore io.getstream.flutter 1651569762"
60+
}
6261

63-
settings_to_override = {
64-
:BUNDLE_IDENTIFIER => "io.getstream.flutter",
65-
:PROVISIONING_PROFILE_SPECIFIER => "match AppStore io.getstream.flutter 1651569762"
66-
}
62+
gym(
63+
workspace: "./Runner.xcworkspace",
64+
scheme: "Runner",
65+
export_method: "app-store",
66+
export_options: "./fastlane/testflight_gym_export_options.plist",
67+
silent: true,
68+
clean: true,
69+
xcargs: settings_to_override,
70+
include_symbols: true,
71+
output_directory: "./dist",
72+
)
6773

68-
gym(
69-
workspace: "./Runner.xcworkspace",
70-
scheme: "Runner",
71-
export_method: "app-store",
72-
export_options: "./fastlane/testflight_gym_export_options.plist",
73-
silent: true,
74-
clean: true,
75-
xcargs: settings_to_override,
76-
include_symbols: true,
77-
output_directory: "./dist",
78-
)
74+
message = changelog_from_git_commits(commits_count: 10)
75+
76+
upload_to_testflight(
77+
groups: ['Public'],
78+
distribute_external: true,
79+
changelog: message,
80+
username: '[email protected]',
81+
reject_build_waiting_for_review: true
82+
)
83+
end
7984

80-
message = changelog_from_git_commits(commits_count: 10)
8185

82-
upload_to_testflight(
83-
groups: ['Public'],
84-
distribute_external: true,
85-
changelog: message,
86-
username: '[email protected]',
87-
reject_build_waiting_for_review: true
88-
)
89-
end
86+
private_lane :appstore_api_key do
87+
@appstore_api_key ||= app_store_connect_api_key(
88+
key_id: 'MT3PRT8TB7',
89+
issuer_id: '69a6de96-0738-47e3-e053-5b8c7c11a4d1',
90+
key_content: ENV.fetch('APPSTORE_API_KEY', nil),
91+
in_house: false
92+
)
9093
end

0 commit comments

Comments
 (0)