From b29017348602ee63053c23591a8aeabd9d2f25b8 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 4 Feb 2019 12:04:48 -0500 Subject: [PATCH] Update travis scripts --- .travis.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index fe57b5c..48f844b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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