Skip to content

Commit

Permalink
v++
Browse files Browse the repository at this point in the history
  • Loading branch information
Honza Dvorsky committed Sep 5, 2015
1 parent 9c01d2d commit 46692b0
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 83 deletions.
2 changes: 1 addition & 1 deletion XcodeServerSDK.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "XcodeServerSDK"
s.version = "0.2.0"
s.version = "0.2.1"
s.summary = "Access Xcode Server API with native Swift objects."

s.homepage = "https://github.com/czechboy0/XcodeServerSDK"
Expand Down
150 changes: 68 additions & 82 deletions fastlane/Fastfile
Expand Up @@ -8,88 +8,74 @@

# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "1.23.0"

default_platform :mac

platform :mac do

before_all do |lane|
end

lane :prebuild do
cocoapods
end

lane :postbuild do
# nada
end

lane :release do

# prep the local state
ensure_git_status_clean
ensure_git_branch(branch: "swift-2")
git_pull

# regen the changelog and open it
sh "cd .. && github_changelog_generator -t $GITHUB_TOKEN && subl CHANGELOG.md"

# assume version from the podspec
version = read_podspec['source']['tag']

# ask for info
title = prompt(text: 'Release Title: ')
description = prompt(text: "Release changelog: ",
multi_line_end_keyword: "END")

# create a new release on GitHub
repo_url = "czechboy0/XcodeServerSDK"
release = set_github_release(
repository_name: repo_url,
api_token: ENV["GITHUB_TOKEN"],
name: [version, title].join(" - "),
tag_name: version,
description: description,
is_draft: false,
is_prerelease: false
)

# release podspec to cocoapods
sh "cd .. && pod trunk push"

# notify us on slack
slack(
slack_url: ENV['SLACK_RELEASES_URL'],
message: "Successfully released [XcodeServerSDK #{version}](#{release['html_url']}) :rocket:",
payload: {
"New" => release['body']
}
)

# regenerate changelog to get it committed
sh "cd .. && github_changelog_generator -t $GITHUB_TOKEN"
sh "cd .. && git commit -am \"changelog\" && git push"

end

after_all do |lane|

if lane == :postbuild
slack(
message: "XcodeServerSDK: Build finished"
)
end
end

error do |lane, exception|
if lane == :postbuild
slack(
message: "XcodeServerSDK: Seems like we have a failing build: #{exception.message}",
success: false
)
end
end
fastlane_version "1.24.0"

# -----------

def project_name
"XcodeServerSDK"
end

def project_github_name
"czechboy0/#{project_name}"
end

def release_branch
"swift-2"
end

# -----------

lane :prebuild do
cocoapods
end

lane :release do

# prep the local state
ensure_git_status_clean
ensure_git_branch(branch: release_branch)
git_pull

# regen the changelog and open it
sh "cd .. && github_changelog_generator -t $GITHUB_TOKEN && subl CHANGELOG.md"

# assume version from the podspec
version = read_podspec['source']['tag']

# ask for info
title = prompt(text: 'Release Title: ')
description = prompt(text: "Release changelog: ",
multi_line_end_keyword: "END")

# create a new release on GitHub
repo_url = project_github_name
release = set_github_release(
repository_name: repo_url,
commitish: release_branch,
api_token: ENV["GITHUB_TOKEN"],
name: [version, title].join(" - "),
tag_name: version,
description: description,
is_draft: false,
is_prerelease: false
)

# release podspec to cocoapods
sh "cd .. && pod trunk push"

# notify us on slack
slack(
slack_url: ENV['SLACK_RELEASES_URL'],
message: "Successfully released [#{project_name} #{version}](#{release['html_url']}) :rocket:",
payload: {
"New" => release['body']
}
)

# regenerate changelog to get it committed
sh "cd .. && github_changelog_generator -t $GITHUB_TOKEN"
sh "cd .. && git commit -am \"changelog\" && git push"

end

0 comments on commit 46692b0

Please sign in to comment.