diff --git a/README.markdown b/README.markdown index afd61adc..f1d5106c 100644 --- a/README.markdown +++ b/README.markdown @@ -20,7 +20,7 @@ through the ‘Install the Command-Line Tool…’ menu item under the applicati If you want to hack on `CocoaPods.app`: -You will need Xcode 7.3 or newer. +You will need [Xcode 7.3](https://github.com/CocoaPods/CocoaPods-app/issues/373) and to be [running on El Capitan](https://github.com/CocoaPods/CocoaPods-app/issues/374). ``` sh git clone https://github.com/CocoaPods/CocoaPods-app.git --recursive diff --git a/Rakefile b/Rakefile index 87d814c4..da80484c 100644 --- a/Rakefile +++ b/Rakefile @@ -1063,6 +1063,16 @@ def sparkler_update_key File.read('.sparkler_update_key').strip rescue nil end + + def github_headers + { + 'Content-Type' => 'application/json', + 'User-Agent' => 'runscope/0.1,segiddins', + 'Accept' => 'application/json', + } + end + + namespace :release do task :clean => ['bundle:clean:all', 'app:clean'] @@ -1126,12 +1136,6 @@ namespace :release do @cp_release_notes end - github_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => 'runscope/0.1,segiddins', - 'Accept' => 'application/json', - } - desc "Upload release" task :upload => [] do sha = sha(tarball) @@ -1140,8 +1144,8 @@ namespace :release do puts "Uploading zip as a GitHub release" tarball_name = File.basename(tarball) info = {tag_name: install_cocoapods_version, name: install_cocoapods_version, body: notes} - response = REST.post("https://api.github.com/repos/CocoaPods/CocoaPods-app/releases?access_token=#{github_access_token}", - notes.to_json, github_headers) + response = REST.post("https://api.github.com/repos/CocoaPods/CocoaPods-app/releases?access_token=#{github_access_token}", info.to_json, github_headers) + upload_url = JSON.load(response.body)['upload_url'].gsub('{?name,label}', "?name=#{tarball_name}&Content-Type=application/x-tar&access_token=#{github_access_token}") response = REST.post(upload_url, File.read(tarball, :mode => 'rb'), github_headers) tarball_download_url = JSON.load(response.body)['browser_download_url'] @@ -1150,7 +1154,9 @@ namespace :release do desc "Version bump the Sparkle XML" task :sparkle => [] do - sh "git clone https://github.com/CocoaPods/CocoaPods-app.git --branch gh-pages --single-branch gh-pages" unless Dir.exists? "./gh-pages" + require 'date' + sh "rm -rf gh-pages" if Dir.exist? "./gh-pages" + sh "git clone https://github.com/CocoaPods/CocoaPods-app.git --branch gh-pages --single-branch gh-pages" version = install_cocoapods_version xml_file = "gh-pages/sparkle.xml" @@ -1208,12 +1214,11 @@ namespace :release do puts "Deployed the Sparkle XML" end + desc "Send a PR to Homebrew Cask" task :homebrew_cask do version = install_cocoapods_version - cask_fork = JSON.load(REST.post("https://api.github.com/repos/caskroom/homebrew-cask/forks?access_token=#{github_access_token}", - {}.to_json, - github_headers).body)["full_name"] + cask_fork = JSON.load(REST.post("https://api.github.com/repos/caskroom/homebrew-cask/forks?access_token=#{github_access_token}",{}.to_json, github_headers).body)["full_name"] branch = "cocoapods-#{version}" message = "Upgrade CocoaPods to v#{version}" body = <