Sure @viktorbenei.
Iβm currently using this release lane:
lane :release do
releaseBranchName = git_branch
unless releaseBranchName.partition('/').first == "release"
raise "Incorrect branch, expected release branch".red
end
sh("git", "fetch")
sh("git", "checkout", releaseBranchName)
version = releaseBranchName.partition('/').last
version_bump_podspec(path: "<<PROJECT_NAME>>.podspec", version_number: version)
cocoapods(clean: true, podfile: "Example/Podfile", repo_update: true)
scan()
pod_lib_lint
sh("git", "add", "-A")
sh("git", "commit", "-m", "Bump version to #{version} [ci skip]")
sh("git", "fetch")
sh("git", "checkout", "master")
sh("git", "merge", releaseBranchName)
sh("git", "tag", version)
sh("git", "push", "origin", "--tags", "master")
sh("git", "checkout", "develop")
sh("git", "merge", "master")
sh("git", "push", "origin", "develop")
pod_push
github_release = set_github_release(repository_name: "<<REPOSITIORY_NAME>>",
api_token: ENV["GITHUB_TOKEN"],
name: version,
tag_name: version,
description: "[Closed Issues](<<GITHUB_LINK_TO_MILESTONE>>)",
commitish: "master")
end
I use this as part of the GitFlow branching scheme.
I make sure Bitrise triggers this lane on "release/*"
, that way when I push a branch thatβs called release/2.2.1
, my fastlane script will assume it needs to update everything to version 2.2.1
.
Cheers, Menno