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