diff --git a/XcodeServerSDK.podspec b/XcodeServerSDK.podspec index 35b303a..4c3cee1 100644 --- a/XcodeServerSDK.podspec +++ b/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" diff --git a/fastlane/Fastfile b/fastlane/Fastfile index e309eeb..03d2b85 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -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