Skip to content

Commit 72bd97f

Browse files
authored
Automated deployment (#29)
* feat: add automated deployment to testflight * chore: remove gh action to push version code updates * chore: change name of gh action to deploy * chore(slack): remove unnecessary spacing in fastfile
1 parent ca464b3 commit 72bd97f

4 files changed

Lines changed: 32 additions & 192 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: React Native Release
1+
name: Deploy
22

33
on:
44
push:
@@ -7,9 +7,13 @@ on:
77
branches:
88
- automated-deployment
99

10+
concurrency:
11+
group: release
12+
cancel-in-progress: true
13+
1014
jobs:
1115
deploy_imessageclone_ios:
12-
name: Deploy iMessage clone iOS to Firebase App Distribution
16+
name: Deploy iMessage clone iOS to Testflight
1317
runs-on: macos-latest
1418
steps:
1519
- uses: actions/checkout@master
@@ -49,12 +53,15 @@ jobs:
4953
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
5054
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
5155
FIREBASE_TOKEN: ${{ secrets.FIREBASE_APP_DISTRIBUTION_TOKEN }}
56+
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}
57+
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
58+
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}
5259
run: |
5360
cd projects/iMessageClone;
54-
bundle exec fastlane ios deploy_to_firebase branch:${{ github.head_ref || github.ref_name }};
61+
bundle exec fastlane ios deploy_to_testflight branch:${{ github.head_ref || github.ref_name }};
5562
5663
deploy_slackclone_ios:
57-
name: Deploy Slack clone iOS to Firebase App Distribution
64+
name: Deploy Slack clone iOS to Testflight
5865
runs-on: macos-latest
5966
steps:
6067
- uses: actions/checkout@master
@@ -94,12 +101,15 @@ jobs:
94101
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
95102
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
96103
FIREBASE_TOKEN: ${{ secrets.FIREBASE_APP_DISTRIBUTION_TOKEN }}
104+
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}
105+
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
106+
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}
97107
run: |
98108
cd projects/SlackClone;
99-
bundle exec fastlane ios deploy_to_firebase branch:${{ github.head_ref || github.ref_name }};
109+
bundle exec fastlane ios deploy_to_testflight branch:${{ github.head_ref || github.ref_name }};
100110
101111
deploy_whatsappclone_ios:
102-
name: Deploy Whatsapp clone iOS to Firebase App Distribution
112+
name: Deploy Whatsapp clone iOS to Testflight
103113
runs-on: macos-latest
104114
steps:
105115
- uses: actions/checkout@master
@@ -139,9 +149,12 @@ jobs:
139149
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
140150
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
141151
FIREBASE_TOKEN: ${{ secrets.FIREBASE_APP_DISTRIBUTION_TOKEN }}
152+
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}
153+
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
154+
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}
142155
run: |
143156
cd projects/WhatsAppClone;
144-
bundle exec fastlane ios deploy_to_firebase branch:${{ github.head_ref || github.ref_name }};
157+
bundle exec fastlane ios deploy_to_testflight branch:${{ github.head_ref || github.ref_name }};
145158
146159
deploy_imessageclone_android:
147160
name: Deploy iMessage clone Android to Firebase App Distribution
@@ -268,57 +281,3 @@ jobs:
268281
run: |
269282
cd projects/WhatsAppClone;
270283
bundle exec fastlane android deploy_to_firebase branch:${{ github.head_ref || github.ref_name }};
271-
272-
push_version_changes:
273-
name: Push version code updates
274-
runs-on: macos-latest
275-
needs:
276-
[
277-
deploy_imessageclone_ios,
278-
deploy_slackclone_ios,
279-
deploy_whatsappclone_ios,
280-
deploy_imessageclone_android,
281-
deploy_slackclone_android,
282-
deploy_whatsappclone_android,
283-
]
284-
steps:
285-
- uses: actions/checkout@master
286-
with:
287-
persist-credentials: false
288-
fetch-depth: 0
289-
- name: Install Ruby and Gems for iMessageClone
290-
uses: ruby/setup-ruby@v1
291-
with:
292-
working-directory: projects/iMessageClone
293-
bundler-cache: true
294-
- name: Build and deploy iMessageClone
295-
run: |
296-
cd projects/iMessageClone;
297-
bundle exec fastlane run increment_build_number xcodeproj:"./ios/iMessageCloneReactNative.xcodeproj";
298-
bundle exec fastlane run increment_version_code gradle_file_path:"./android/app/build.gradle";
299-
- name: Install Ruby and Gems for Slack Clone
300-
uses: ruby/setup-ruby@v1
301-
with:
302-
working-directory: projects/SlackClone
303-
bundler-cache: true
304-
- name: Build and deploy SlackClone
305-
run: |
306-
cd projects/WhatsAppClone;
307-
bundle exec fastlane run increment_build_number xcodeproj:"./ios/SlackCloneReactNative.xcodeproj";
308-
bundle exec fastlane run increment_version_code gradle_file_path:"./android/app/build.gradle";
309-
- name: Install Ruby and Gems for Slack Clone
310-
uses: ruby/setup-ruby@v1
311-
with:
312-
working-directory: projects/WhatsAppClone
313-
bundler-cache: true
314-
- name: Build and deploy WhatsAppClone
315-
run: |
316-
cd projects/WhatsAppClone;
317-
bundle exec fastlane run increment_build_number xcodeproj:"./ios/WhatsAppCloneReactNative.xcodeproj";
318-
bundle exec fastlane run increment_version_code gradle_file_path:"./android/app/build.gradle";
319-
- name: Commit & Push changes
320-
uses: actions-js/push@master
321-
with:
322-
message: "chore: bump iOS and Android version [skip ci]"
323-
github_token: ${{ secrets.GITHUB_TOKEN }}
324-
branch: ${{ github.head_ref || github.ref_name }}

projects/SlackClone/fastlane/Fastfile

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
# update_fastlane
1515
default_platform(:ios)
1616

17-
1817
before_all do
1918
if is_ci
2019
setup_ci()
2120
end
2221
end
2322

24-
2523
desc "Installs all Certs and Profiles necessary for ad-hoc"
2624
lane :match_me do
2725
match(
@@ -45,50 +43,9 @@ lane :match_appstore do
4543
)
4644
end
4745

48-
platform :ios do
49-
desc "Deploy iOS build to Firebase"
50-
lane :deploy_to_firebase do |options|
51-
match_me
52-
53-
settings_to_override = {
54-
:BUNDLE_IDENTIFIER => "io.getstream.reactnative.slackclone",
55-
:PROVISIONING_PROFILE_SPECIFIER => "match AdHoc io.getstream.reactnative.slackclone"
56-
}
57-
58-
package = load_json(json_path: "./package.json")
59-
version_name_addition = (options[:branch] == "main") ? "-pub" : "-dev"
60-
increment_version_number(
61-
version_number: package["version"] + version_name_addition,
62-
xcodeproj: "./ios/SlackCloneReactNative.xcodeproj"
63-
)
64-
65-
increment_build_number(
66-
xcodeproj:"./ios/SlackCloneReactNative.xcodeproj"
67-
)
68-
69-
gym(
70-
workspace: "./ios/SlackCloneReactNative.xcworkspace",
71-
scheme: "SlackCloneReactNative",
72-
export_method: "ad-hoc",
73-
export_options: "./fastlane/beta_gym_export_options.plist",
74-
silent: true,
75-
clean: true,
76-
xcargs: settings_to_override,
77-
include_symbols: true,
78-
output_directory: "./dist",
79-
)
80-
81-
firebase_groups_addition = (options[:branch] == "main") ? ", slack-public-1" : ""
82-
firebase_app_distribution(
83-
app: "1:296557120037:ios:c96ba73046f424b8f60dcc",
84-
groups: "react-native-dev" + firebase_groups_addition,
85-
)
86-
end
87-
end
88-
8946
platform :ios do
9047
desc "Deploy iOS build to TestFlight"
91-
lane :deploy_to_testflight do
48+
lane :deploy_to_testflight do |options|
9249
app_store_connect_api_key()
9350

9451
match_appstore
@@ -123,9 +80,11 @@ platform :ios do
12380
output_directory: "./dist",
12481
)
12582

83+
testflight_groups = (options[:branch] == "main") ? ['Dev Testers', 'Public Testers'] : ['Dev Testers']
84+
12685
begin
12786
upload_to_testflight(
128-
groups: ['Dev Testers', 'Public Testers'],
87+
groups: testflight_groups,
12988
changelog: "Lots of amazing new features to test out!",
13089
reject_build_waiting_for_review: false,
13190
skip_waiting_for_build_processing: true,

projects/WhatsAppClone/fastlane/Fastfile

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -45,50 +45,9 @@ lane :match_appstore do
4545
)
4646
end
4747

48-
platform :ios do
49-
desc "Deploy iOS build to Firebase"
50-
lane :deploy_to_firebase do |options|
51-
match_me
52-
53-
settings_to_override = {
54-
:BUNDLE_IDENTIFIER => "io.getstream.reactnative.whatsappclone",
55-
:PROVISIONING_PROFILE_SPECIFIER => "match AdHoc io.getstream.reactnative.whatsappclone"
56-
}
57-
58-
59-
package = load_json(json_path: "./package.json")
60-
version_name_addition = (options[:branch] == "main") ? "-pub" : "-dev"
61-
increment_version_number(
62-
version_number: package["version"] + version_name_addition,
63-
xcodeproj: "./ios/WhatsAppCloneReactNative.xcodeproj"
64-
)
65-
66-
increment_build_number(
67-
xcodeproj: "./ios/WhatsAppCloneReactNative.xcodeproj"
68-
)
69-
70-
gym(
71-
workspace: "./ios/WhatsAppCloneReactNative.xcworkspace",
72-
scheme: "WhatsAppCloneReactNative",
73-
export_method: "ad-hoc",
74-
export_options: "./fastlane/beta_gym_export_options.plist",
75-
silent: true,
76-
clean: true,
77-
xcargs: settings_to_override,
78-
include_symbols: true,
79-
output_directory: "./dist",
80-
)
81-
firebase_groups_addition = (options[:branch] == "main") ? ", whatsapp-public-1" : ""
82-
firebase_app_distribution(
83-
app: "1:296557120037:ios:e315faab5af9cde0f60dcc",
84-
groups: "react-native-dev" + firebase_groups_addition,
85-
)
86-
end
87-
end
88-
8948
platform :ios do
9049
desc "Deploy iOS build to TestFlight"
91-
lane :deploy_to_testflight do
50+
lane :deploy_to_testflight do |options|
9251
app_store_connect_api_key()
9352

9453
match_appstore
@@ -123,9 +82,11 @@ platform :ios do
12382
output_directory: "./dist",
12483
)
12584

85+
testflight_groups = (options[:branch] == "main") ? ['Dev Testers', 'Public Testers'] : ['Dev Testers']
86+
12687
begin
12788
upload_to_testflight(
128-
groups: ['Dev Testers', 'Public Testers'],
89+
groups: testflight_groups,
12990
changelog: "Lots of amazing new features to test out!",
13091
reject_build_waiting_for_review: false,
13192
skip_waiting_for_build_processing: true,

projects/iMessageClone/fastlane/Fastfile

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -45,50 +45,9 @@ lane :match_appstore do
4545
)
4646
end
4747

48-
platform :ios do
49-
desc "Deploy iOS build to Firebase"
50-
lane :deploy_to_firebase do |options|
51-
match_me
52-
53-
settings_to_override = {
54-
:BUNDLE_IDENTIFIER => "io.getstream.reactnative.imessageclone",
55-
:PROVISIONING_PROFILE_SPECIFIER => "match AdHoc io.getstream.reactnative.imessageclone"
56-
}
57-
58-
package = load_json(json_path: "./package.json")
59-
60-
version_name_addition = (options[:branch] == "main") ? "-pub" : "-dev"
61-
increment_version_number(
62-
version_number: package["version"] + version_name_addition,
63-
xcodeproj: "./ios/iMessageCloneReactNative.xcodeproj"
64-
)
65-
66-
increment_build_number(
67-
xcodeproj:"./ios/iMessageCloneReactNative.xcodeproj"
68-
)
69-
70-
gym(
71-
workspace: "./ios/iMessageCloneReactNative.xcworkspace",
72-
scheme: "iMessageCloneReactNative",
73-
export_method: "ad-hoc",
74-
export_options: "./fastlane/beta_gym_export_options.plist",
75-
silent: true,
76-
clean: true,
77-
xcargs: settings_to_override,
78-
include_symbols: true,
79-
output_directory: "./dist",
80-
)
81-
firebase_groups_addition = (options[:branch] == "main") ? ", imessage-public-1" : ""
82-
firebase_app_distribution(
83-
app: "1:296557120037:ios:6def3152d11bba4cf60dcc",
84-
groups: "react-native-dev" + firebase_groups_addition,
85-
)
86-
end
87-
end
88-
8948
platform :ios do
9049
desc "Deploy iOS build to TestFlight"
91-
lane :deploy_to_testflight do
50+
lane :deploy_to_testflight do |options|
9251
app_store_connect_api_key()
9352

9453
match_appstore
@@ -123,9 +82,11 @@ platform :ios do
12382
output_directory: "./dist",
12483
)
12584

85+
testflight_groups = (options[:branch] == "main") ? ['Dev Testers', 'Public Testers'] : ['Dev Testers']
86+
12687
begin
12788
upload_to_testflight(
128-
groups: ['Dev Testers', 'Public Testers'],
89+
groups: testflight_groups,
12990
changelog: "Lots of amazing new features to test out!",
13091
reject_build_waiting_for_review: false,
13192
skip_waiting_for_build_processing: true,

0 commit comments

Comments
 (0)