Skip to content

Commit

Permalink
Checking tags, versions and CHANGELOG on fastlane release lane
Browse files Browse the repository at this point in the history
  • Loading branch information
fjcaetano committed Jan 10, 2018
1 parent 445a1e9 commit 4dc03d5
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,25 @@ platform :ios do

desc "Deploy a new version to Github and Cocoapods"
lane :release do
# Checking files
tag = last_git_tag

did_succeed = true
if version_get_podspec != tag
UI.error "Podspec version different than tag name"
did_succeed = false
end

changelog_contents = File.read '../CHANGELOG.md'
if !changelog_contents.include? tag
UI.error "CHANGELOG hasn't been updated"
did_succeed = false
end

if !did_succeed
exit 1
end

carthage(
command: "archive",
)
Expand All @@ -100,14 +119,14 @@ platform :ios do

prev_tag = sh "git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`"
changelog = changelog_from_git_commits(
between: [last_git_tag, prev_tag.strip],
between: [tag, prev_tag.strip],
pretty: "- %s"
)

set_github_release(
repository_name: "fjcaetano/ReCaptcha",
tag_name: last_git_tag,
name: last_git_tag,
tag_name: tag,
name: tag,
upload_assets: ["ReCaptcha.framework.zip"],
description: changelog,
)
Expand Down

0 comments on commit 4dc03d5

Please sign in to comment.