Skip to content

Commit ff1ef09

Browse files
committed
fix build run
1 parent d188172 commit ff1ef09

File tree

5 files changed

+118
-69
lines changed

5 files changed

+118
-69
lines changed

.github/workflows/build_nightly.yml

Lines changed: 55 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,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: 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: 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

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: 57 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fastlane_version "2.195.0"
1+
fastlane_version "2.226.0"
22
default_platform :ios
33

44
before_all do
@@ -10,6 +10,7 @@ end
1010
desc "Installs all Certs and Profiles necessary for development and ad-hoc"
1111
lane :match_me do
1212
match(
13+
api_key: appstore_api_key,
1314
type: "adhoc",
1415
app_identifier: [
1516
"io.getstream.flutter",
@@ -22,6 +23,7 @@ end
2223
desc "Installs all Certs and Profiles necessary for appstore"
2324
lane :match_appstore do
2425
match(
26+
api_key: appstore_api_key,
2527
type: "appstore",
2628
app_identifier: [
2729
"io.getstream.flutter",
@@ -30,61 +32,66 @@ lane :match_appstore do
3032
)
3133
end
3234

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-
)
35+
lane :deploy_to_firebase do
36+
match_me
4837

49-
message = changelog_from_git_commits(commits_count: 10)
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+
)
5048

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

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

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

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-
)
77+
message = changelog_from_git_commits(commits_count: 10)
78+
79+
upload_to_testflight(
80+
api_key: appstore_api_key,
81+
groups: ['Public'],
82+
distribute_external: true,
83+
changelog: message,
84+
username: '[email protected]',
85+
reject_build_waiting_for_review: true
86+
)
87+
end
7988

80-
message = changelog_from_git_commits(commits_count: 10)
8189

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
90+
private_lane :appstore_api_key do
91+
@appstore_api_key ||= app_store_connect_api_key(
92+
key_id: 'MT3PRT8TB7',
93+
issuer_id: '69a6de96-0738-47e3-e053-5b8c7c11a4d1',
94+
key_content: ENV.fetch('APPSTORE_API_KEY', nil),
95+
in_house: false
96+
)
9097
end

0 commit comments

Comments
 (0)