File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,23 @@ lane :publish_release do |options|
100
100
update_spm ( version : options [ :version ] )
101
101
end
102
102
103
+ lane :merge_release_to_main do
104
+ ensure_git_status_clean
105
+ sh ( 'git checkout main' )
106
+ sh ( 'git pull' )
107
+
108
+ # Grep all remote release branches and ensure there's only one
109
+ release_branches = sh ( command : 'git branch -a' , log : false ) . delete ( ' ' ) . split ( "\n " ) . grep ( %r(origin/.*release/) )
110
+ UI . user_error! ( "Expected 1 release branch, found #{ release_branches . size } " ) if release_branches . size != 1
111
+
112
+ # Merge release branch to main. For more info, read: https://notion.so/iOS-Branching-Strategy-37c10127dc26493e937769d44b1d6d9a
113
+ sh ( "git merge #{ release_branches . first } --ff-only" )
114
+ UI . user_error! ( 'Not pushing changes' ) unless prompt ( text : 'Will push changes. All looking good?' , boolean : true )
115
+ sh ( 'git push' )
116
+ UI . important ( 'Please, wait for the `Publish new release` workflow to pass on GitHub Actions: ' \
117
+ "https://github.com/#{ github_repo } /actions/workflows/publish-release.yml" )
118
+ end
119
+
103
120
private_lane :appstore_api_key do
104
121
@appstore_api_key ||= app_store_connect_api_key (
105
122
key_id : 'MT3PRT8TB7' ,
You can’t perform that action at this time.
0 commit comments