Update travis scripts

This commit is contained in:
Max Howell
2019-02-04 12:04:48 -05:00
parent 8248354a80
commit b290173486

View File

@@ -90,12 +90,15 @@ jobs:
tags: true
- name: CocoaPods
before_install: |
before_install: export TRAVIS_REPO_NAME=${TRAVIS_REPO_SLUG#*/}
install: gem install cocoapods --pre
before_script: |
export DESCRIPTION=$(swift - <<\ \ EOF
import Foundation
struct Response: Decodable { let description: String }
let token = ProcessInfo.processInfo.environment["GITHUB_TOKEN"]!
let url = URL(string: "https://api.github.com/repos/mxcl/Path.swift")!
let slug = ProcessInfo.processInfo.environment["TRAVIS_REPO_SLUG"]!
let url = URL(string: "https://api.github.com/repos/\(slug)")!
var rq = URLRequest(url: url)
rq.setValue("token \(token)", forHTTPHeaderField: "Authorization")
let semaphore = DispatchSemaphore(value: 0)
@@ -108,15 +111,15 @@ jobs:
let rsp = try JSONDecoder().decode(Response.self, from: data)
print(rsp.description, terminator: "")
EOF)
cat <<\ \ EOF> Path.swift.podspec
cat <<\ \ EOF> $TRAVIS_REPO_NAME.podspec
Pod::Spec.new do |s|
s.name = 'Path.swift'
s.name = ENV['TRAVIS_REPO_NAME']
s.version = ENV['TRAVIS_TAG']
s.summary = ENV['DESCRIPTION']
s.homepage = 'https://github.com/mxcl/Path.swift'
s.license = { :type => 'Unlicense', :file => 'LICENSE.md' }
s.author = { 'mxcl' => 'mxcl@me.com' }
s.source = { :git => 'https://github.com/mxcl/Path.swift.git', :tag => s.version.to_s }
s.homepage = "https://github.com/#{ENV['TRAVIS_REPO_SLUG']}"
s.license = { type: 'Unlicense', file: 'LICENSE.md' }
s.author = { mxcl: 'mxcl@me.com' }
s.source = { git: "https://github.com/#{ENV['TRAVIS_REPO_SLUG']}.git", tag: s.version }
s.social_media_url = 'https://twitter.com/mxcl'
s.osx.deployment_target = '10.10'
s.ios.deployment_target = '8.0'
@@ -126,5 +129,4 @@ jobs:
s.swift_version = '4.2'
end
EOF
install: gem install cocoapods --pre
script: pod trunk push