Skip to content

Commit 62efc5d

Browse files
[CI] Automate the release step of merging the main branch to develop (#856)
1 parent 59e984c commit 62efc5d

File tree

5 files changed

+38
-12
lines changed

5 files changed

+38
-12
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Merge main to develop"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
merge:
11+
name: Merge
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/[email protected]
15+
with:
16+
token: ${{ secrets.ADMIN_API_TOKEN }}
17+
fetch-depth: 0
18+
19+
- uses: ./.github/actions/ruby-cache
20+
21+
- run: bundle exec fastlane merge_main
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.ADMIN_API_TOKEN }}
24+
25+
- uses: 8398a7/action-slack@v3
26+
if: failure()
27+
with:
28+
status: ${{ job.status }}
29+
text: "⚠️ <!subteam^S030AAHLDLN>, the merge of `main` to `develop` failed on CI. Consider using this command locally: `bundle exec fastlane merge_main`"
30+
fields: repo,commit,author,workflow
31+
env:
32+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/release-publish.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,3 @@ jobs:
2626
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
2727
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
2828
run: bundle exec fastlane publish_release --verbose
29-
30-
- uses: 8398a7/action-slack@v3
31-
with:
32-
status: ${{ job.status }}
33-
text: "🎉 The new release has been shipped! 🚢\n\n⚠️ <!subteam^S030AAHLDLN>, don't forget to merge `main` back to `develop` from `localhost` using the command: `bundle exec fastlane merge_main`"
34-
fields: repo
35-
env:
36-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ GEM
207207
fastlane
208208
pry
209209
fastlane-plugin-sonarcloud_metric_kit (0.2.1)
210-
fastlane-plugin-stream_actions (0.3.83)
210+
fastlane-plugin-stream_actions (0.3.84)
211211
xctest_list (= 1.2.1)
212212
fastlane-plugin-versioning (0.7.1)
213213
fastlane-sirp (1.0.0)
@@ -421,7 +421,7 @@ DEPENDENCIES
421421
fastlane-plugin-create_xcframework
422422
fastlane-plugin-lizard
423423
fastlane-plugin-sonarcloud_metric_kit
424-
fastlane-plugin-stream_actions (= 0.3.83)
424+
fastlane-plugin-stream_actions (= 0.3.84)
425425
fastlane-plugin-versioning
426426
json
427427
plist

fastlane/Fastfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ before_all do |lane|
2323
if is_ci
2424
setup_ci
2525
setup_git_config
26-
select_xcode(version: xcode_version) unless [:sonar_upload, :allure_launch, :allure_upload, :copyright, :pod_lint].include?(lane)
26+
select_xcode(version: xcode_version) unless [:sonar_upload, :allure_launch, :allure_upload, :copyright, :pod_lint, :merge_main].include?(lane)
2727
end
2828
end
2929

@@ -142,6 +142,8 @@ lane :publish_release do |options|
142142
)
143143

144144
update_spm(version: release_version)
145+
146+
sh('gh workflow run merge-main-to-develop.yml --ref main')
145147
end
146148

147149
lane :get_sdk_version_from_environment do

fastlane/Pluginfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
gem 'fastlane-plugin-versioning'
66
gem 'fastlane-plugin-sonarcloud_metric_kit'
77
gem 'fastlane-plugin-create_xcframework'
8-
gem 'fastlane-plugin-stream_actions', '0.3.83'
8+
gem 'fastlane-plugin-stream_actions', '0.3.84'

0 commit comments

Comments
 (0)