Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -244,23 +244,23 @@ platform :ios do

def create_tag(tag, branch)
data = {tag_name: tag, target_commitish: branch, name: tag, body: '', draft: false, prerelease: false}.to_json
url = "https://api.github.com/repos/#{slug}/releases?access_token=#{access_token}"
url = "https://api.github.com/repos/#{slug}/releases"

out, status = Open3.capture2(*['curl', '-sSL', '-d', "#{data}", "#{url}"])
out, status = Open3.capture2(*['curl', '-sSL', '-H', "Authorization: token #{access_token}", '-d', "#{data}", "#{url}"])
JSON.parse(out)
end

def upload_release(filepath, release_id)
filename = File.basename(filepath)
url = "https://uploads.github.com/repos/#{slug}/releases/#{release_id}/assets?name=#{filename}&access_token=#{access_token}"
url = "https://uploads.github.com/repos/#{slug}/releases/#{release_id}/assets?name=#{filename}"

Fastlane::Actions::sh %[curl -sSL -X POST "#{url}" -H "Content-Type: application/gzip" --data-binary @"#{filepath}"]
Fastlane::Actions::sh %[curl -sSL -H "Authorization: token #{access_token}" -X POST "#{url}" -H "Content-Type: application/gzip" --data-binary @"#{filepath}"]
end

def find_release(hash)
url = "https://api.github.com/repos/#{slug}/releases/tags/#{hash}?access_token=#{access_token}"
url = "https://api.github.com/repos/#{slug}/releases/tags/#{hash}"

out, status = Open3.capture2(*['curl', '-sSL', "#{url}"])
out, status = Open3.capture2(*['curl', '-sSL', '-H', "Authorization: token #{access_token}", "#{url}"])
JSON.parse(out)
end

Expand All @@ -269,7 +269,7 @@ platform :ios do
end

def asset_url(asset_id)
"https://api.github.com/repos/#{slug}/releases/assets/#{asset_id}?access_token=#{access_token}"
"https://api.github.com/repos/#{slug}/releases/assets/#{asset_id}"
end
end

Expand Down