cocoapods-release 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pod/command/release.rb +31 -3
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c39e77b06cea0c64ffd18f525e29a1fc151902a
|
4
|
+
data.tar.gz: 2a93fe9b25258b2a5928af60faf1951f02ac6c51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dff05b686e3e9520272b7ce6ab3ac7e8ddab308c059088cd0909bb3b2632483780c368d6f9f4140c6d0792526a94039eb8d3dcfdb256f3e694e377adf224424f
|
7
|
+
data.tar.gz: b55b7dbe5401b290a30f4f5f4209e5fd35d6ca2c41b5b23edf7f0e0a775f7c82b783a1416b87c468f8febb76a26989e1d88cee1e282557b9be895f4efb0efb34
|
data/lib/pod/command/release.rb
CHANGED
@@ -3,9 +3,11 @@ module Pod
|
|
3
3
|
class Release < Command
|
4
4
|
self.summary = 'Release podspecs in current directory'
|
5
5
|
|
6
|
-
def execute(command)
|
6
|
+
def execute(command, options = {})
|
7
|
+
options = { :optional => false }.merge options
|
8
|
+
|
7
9
|
puts "#{"==>".magenta} #{command}"
|
8
|
-
abort unless system(command)
|
10
|
+
abort unless (system(command) || options[:optional])
|
9
11
|
end
|
10
12
|
|
11
13
|
self.arguments = [
|
@@ -15,6 +17,7 @@ module Pod
|
|
15
17
|
def self.options
|
16
18
|
[
|
17
19
|
['--allow-warnings', 'Allows push even if there are lint warnings'],
|
20
|
+
['--carthage', 'Validates project for carthage deployment'],
|
18
21
|
].concat(super.reject { |option, _| option == '--silent' })
|
19
22
|
end
|
20
23
|
|
@@ -22,6 +25,7 @@ module Pod
|
|
22
25
|
warnings = argv.flag?('allow-warnings')
|
23
26
|
@allow_warnings = warnings ? "--allow-warnings" : ""
|
24
27
|
@repo = argv.shift_argument unless argv.arguments.empty?
|
28
|
+
@carthage = argv.flag?('carthage')
|
25
29
|
super
|
26
30
|
end
|
27
31
|
|
@@ -35,6 +39,7 @@ module Pod
|
|
35
39
|
for spec in specs
|
36
40
|
name = spec.gsub(".podspec", "")
|
37
41
|
version = Specification.from_file(spec).version
|
42
|
+
name = Specification.from_file(spec).name
|
38
43
|
|
39
44
|
sources = SourcesManager.all.select { |r| r.name == "master" || r.url.start_with?("git") }
|
40
45
|
sources = sources.select { |s| s.name == @repo } if @repo
|
@@ -76,9 +81,13 @@ module Pod
|
|
76
81
|
execute "pod lib lint #{spec} #{@allow_warnings} --sources=#{available_sources.join(',')}"
|
77
82
|
execute "pod lib lint #{spec} --use-libraries #{@allow_warnings} --sources=#{available_sources.join(',')}"
|
78
83
|
|
84
|
+
if @carthage
|
85
|
+
execute "carthage build --no-skip-current"
|
86
|
+
end
|
87
|
+
|
79
88
|
# TODO: create git tag for current version
|
80
89
|
unless system("git tag | grep #{version} > /dev/null")
|
81
|
-
execute "git add -A && git commit -m \"Releases #{version}.\""
|
90
|
+
execute "git add -A && git commit -m \"Releases #{version}.\"", :optional => true
|
82
91
|
execute "git tag #{version}"
|
83
92
|
execute "git push && git push --tags"
|
84
93
|
end
|
@@ -89,6 +98,25 @@ module Pod
|
|
89
98
|
else
|
90
99
|
execute "pod repo push #{repo} #{spec} #{@allow_warnings}"
|
91
100
|
end
|
101
|
+
|
102
|
+
if @carthage && `git remote show origin`.include?("git@github.com")
|
103
|
+
execute "carthage archive #{name}"
|
104
|
+
|
105
|
+
user, repo = /git@github.com:(.*)\/(.*).git/.match(`git remote show origin`)[1, 2]
|
106
|
+
file = "#{name}.framework.zip"
|
107
|
+
|
108
|
+
create_release = %(github-release release --user #{user} --repo #{repo} --tag #{version} --name "Version #{version}" --description "Release of version #{version}")
|
109
|
+
upload_release = %(github-release upload --user #{user} --repo #{repo} --tag #{version} --name "#{file}" --file "#{file}")
|
110
|
+
|
111
|
+
if ENV['GITHUB_TOKEN'] && system("which github-release")
|
112
|
+
execute create_release
|
113
|
+
execute upload_release
|
114
|
+
execute "rm #{file}"
|
115
|
+
else
|
116
|
+
puts "Run `#{create_release} --security-token XXX` to create a github release and"
|
117
|
+
puts " `#{upload_release} --security-token XXX` to upload to github releases"
|
118
|
+
end
|
119
|
+
end
|
92
120
|
end
|
93
121
|
end
|
94
122
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-release
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oliver Letterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|