cocoapods-release 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 782f3bf72f5b8b55b4cc1397f95bdac6a87abf62
4
- data.tar.gz: eaade8700977262a315600b738e9d39150949882
3
+ metadata.gz: 7c39e77b06cea0c64ffd18f525e29a1fc151902a
4
+ data.tar.gz: 2a93fe9b25258b2a5928af60faf1951f02ac6c51
5
5
  SHA512:
6
- metadata.gz: a76f76a17aea9f21c4d33c9199877b47c40aadc9c8d53759d895bc026b0a9bcdc03dc758d1ed9a3b0462a8c5b1264b50a3992be1ff2f54d9a9f42167a47f00fc
7
- data.tar.gz: 54dfbc950e24513f39f43aafee6d273c0fb3d9a70d903c11956a7f7e98097422871762b52e0353c9d25fd211db9f91e22b09859d89e1d142ba2e6b723bb027b6
6
+ metadata.gz: dff05b686e3e9520272b7ce6ab3ac7e8ddab308c059088cd0909bb3b2632483780c368d6f9f4140c6d0792526a94039eb8d3dcfdb256f3e694e377adf224424f
7
+ data.tar.gz: b55b7dbe5401b290a30f4f5f4209e5fd35d6ca2c41b5b23edf7f0e0a775f7c82b783a1416b87c468f8febb76a26989e1d88cee1e282557b9be895f4efb0efb34
@@ -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
@@ -1,3 +1,3 @@
1
1
  module CocoapodRelease
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.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-03-25 00:00:00.000000000 Z
11
+ date: 2015-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler