releasinator 0.1.1 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +3 -5
- data/.releasinator.rb +23 -5
- data/CHANGELOG.md +10 -1
- data/Gemfile.lock +5 -1
- data/lib/current_release.rb +3 -3
- data/lib/publisher.rb +3 -3
- data/lib/releasinator/version.rb +1 -1
- data/lib/tasks/releasinator.rake +25 -26
- data/releasinator.gemspec +1 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d262a01d868cfb7a782dd4c1dca96e2879ccabab
|
4
|
+
data.tar.gz: 2ba14042c8eccd4485b4c85fd4a8aa49e7eb0136
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b97d926007fb5f9f79cdd777c0720124063df22ec0bbcd5c359758e5a3e544b0792050e0f1e86c7d6d224fc3ec3be23501503a77171d939deee950f454ea33a1
|
7
|
+
data.tar.gz: 38473a258a6207a7288ffe02eae724165990e3284ba3bd7bc4ba2a0f506ef22f8f16886b52dd85f65a9e36e2733803e8f5f083e5a65e818258d76958b7a337f9
|
data/.github/ISSUE_TEMPLATE.md
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
### Required Information
|
2
2
|
|
3
|
-
-
|
4
|
-
-
|
5
|
-
- Android Version and Device (Motorola Droid Razr Maxx with Android 4.4.2, Samsung S7 with Android 6.0, etc...):
|
6
|
-
- PayPal-Debug-ID(s) (from any logs):
|
3
|
+
- Releasinator Version:
|
4
|
+
- OS and Ruby Version:
|
7
5
|
|
8
6
|
### Issue Description
|
9
|
-
> Please include as many details (logs, steps to reproduce
|
7
|
+
> Please include as many details (logs, steps to reproduce) as you can to help us reproduce this issue faster.
|
data/.releasinator.rb
CHANGED
@@ -4,20 +4,38 @@ configatron.product_name = "Releasinator"
|
|
4
4
|
configatron.prerelease_checklist_items = [
|
5
5
|
]
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
def validate_version_match()
|
8
|
+
require 'releasinator/version'
|
9
|
+
spec_version = Releasinator::VERSION
|
10
|
+
if spec_version != @current_release.version
|
11
|
+
Printer.fail("Ruby gem spec version #{spec_version} does not match changelog version #{@current_release.version}.")
|
12
|
+
abort()
|
13
|
+
end
|
14
|
+
|
15
|
+
Printer.success("Ruby gem spec version #{spec_version} matches latest changelog version.")
|
16
|
+
end
|
17
|
+
|
18
|
+
configatron.custom_validation_methods = [
|
19
|
+
method(:validate_version_match)
|
20
|
+
]
|
21
|
+
|
9
22
|
|
10
23
|
def build_method
|
24
|
+
# run tests first
|
25
|
+
CommandProcessor.command("ruby test/ts_allTests.rb")
|
26
|
+
|
27
|
+
output_dir = "build"
|
11
28
|
CommandProcessor.command("gem build releasinator.gemspec")
|
12
|
-
Dir.mkdir(
|
13
|
-
CommandProcessor.command("mv releasinator-*.gem
|
29
|
+
Dir.mkdir(output_dir) unless File.exists?(output_dir)
|
30
|
+
CommandProcessor.command("mv releasinator-*.gem #{output_dir}")
|
14
31
|
end
|
15
32
|
|
16
33
|
# The command that builds the sdk. Required.
|
17
34
|
configatron.build_method = method(:build_method)
|
18
35
|
|
19
36
|
def publish_to_package_manager(version)
|
20
|
-
|
37
|
+
output_dir = "build"
|
38
|
+
Dir.chdir(output_dir) do
|
21
39
|
CommandProcessor.command("gem push releasinator-#{version}.gem")
|
22
40
|
end
|
23
41
|
end
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,18 @@
|
|
1
1
|
Releasinator release notes
|
2
2
|
==========================
|
3
3
|
|
4
|
+
|
5
|
+
0.2.1
|
6
|
+
-----
|
7
|
+
* Fix current_release renaming bug.
|
8
|
+
|
9
|
+
0.2.0
|
10
|
+
-----
|
11
|
+
* Rename some fields.
|
12
|
+
|
4
13
|
0.1.1
|
5
14
|
-----
|
6
|
-
* Fix validate:gitignore to print more and dirty git
|
15
|
+
* Fix `validate:gitignore` to print more and dirty git.
|
7
16
|
|
8
17
|
0.1.0
|
9
18
|
-----
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
releasinator (0.
|
4
|
+
releasinator (0.2.1)
|
5
5
|
colorize (~> 0.7)
|
6
6
|
configatron (~> 4.5)
|
7
7
|
json (~> 1.8)
|
@@ -22,12 +22,15 @@ GEM
|
|
22
22
|
multipart-post (2.0.0)
|
23
23
|
octokit (4.3.0)
|
24
24
|
sawyer (~> 0.7.0, >= 0.5.3)
|
25
|
+
power_assert (0.2.7)
|
25
26
|
rake (11.1.2)
|
26
27
|
redcarpet (3.3.4)
|
27
28
|
sawyer (0.7.0)
|
28
29
|
addressable (>= 2.3.5, < 2.5)
|
29
30
|
faraday (~> 0.8, < 0.10)
|
30
31
|
semantic (1.4.1)
|
32
|
+
test-unit (3.1.8)
|
33
|
+
power_assert
|
31
34
|
vandamme (0.0.11)
|
32
35
|
github-markup (~> 1.3)
|
33
36
|
redcarpet (~> 3.3.2)
|
@@ -39,6 +42,7 @@ DEPENDENCIES
|
|
39
42
|
bundler (~> 1.11)
|
40
43
|
rake (~> 11.1)
|
41
44
|
releasinator!
|
45
|
+
test-unit (~> 3.1)
|
42
46
|
|
43
47
|
BUNDLED WITH
|
44
48
|
1.11.2
|
data/lib/current_release.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Releasinator
|
2
2
|
class CurrentRelease
|
3
|
-
attr_reader :
|
4
|
-
def initialize(
|
5
|
-
@
|
3
|
+
attr_reader :version, :changelog
|
4
|
+
def initialize(version, changelog)
|
5
|
+
@version = version
|
6
6
|
@changelog = changelog
|
7
7
|
end
|
8
8
|
end
|
data/lib/publisher.rb
CHANGED
@@ -15,8 +15,8 @@ module Releasinator
|
|
15
15
|
begin
|
16
16
|
# https://github.com/octokit/octokit.rb/blob/master/spec/octokit/client/releases_spec.rb#L18
|
17
17
|
github_release = github_repo.client.create_release "#{github_repo.org}/#{github_repo.repo}",
|
18
|
-
release.
|
19
|
-
:name => release.
|
18
|
+
release.version,
|
19
|
+
:name => release.version,
|
20
20
|
:body => release.changelog,
|
21
21
|
:draft => true,
|
22
22
|
:prerelease => false
|
@@ -34,7 +34,7 @@ module Releasinator
|
|
34
34
|
github_pull_request = github_repo.client.create_pull_request "#{github_repo.org}/#{github_repo.repo}",
|
35
35
|
base,
|
36
36
|
head,
|
37
|
-
"Update #{product_name} to #{release.
|
37
|
+
"Update #{product_name} to #{release.version}",
|
38
38
|
release.changelog
|
39
39
|
puts github_pull_request.inspect if @config[:trace]
|
40
40
|
rescue => error
|
data/lib/releasinator/version.rb
CHANGED
data/lib/tasks/releasinator.rake
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'bundler/setup'
|
3
|
-
require 'rake'
|
4
3
|
require 'colorize'
|
5
4
|
require 'json'
|
6
5
|
require 'tempfile'
|
@@ -63,8 +62,8 @@ namespace :validate do
|
|
63
62
|
current_branch = GitUtil.get_current_branch()
|
64
63
|
@validator.validate_matches_branch(current_branch)
|
65
64
|
if use_git_flow()
|
66
|
-
expected_release_branch = "release/#{@
|
67
|
-
abort("git flow expects the current branch to be either 'develop' or 'release/#{@
|
65
|
+
expected_release_branch = "release/#{@current_release.version}"
|
66
|
+
abort("git flow expects the current branch to be either 'develop' or 'release/#{@current_release.version}'. Current branch is '#{current_branch}'".red) unless current_branch == expected_release_branch || current_branch == "develop"
|
68
67
|
else
|
69
68
|
abort("non-git flow expects releases to come from the master branch. Current branch is '#{current_branch}'".red) unless current_branch == "master"
|
70
69
|
end
|
@@ -94,7 +93,7 @@ namespace :validate do
|
|
94
93
|
|
95
94
|
desc "validate the presence, formatting, and semver sequence of CHANGELOG.md"
|
96
95
|
task :changelog => :config do
|
97
|
-
@
|
96
|
+
@current_release = @validator.validate_changelog(get_base_dir(), DOWNSTREAM_REPOS)
|
98
97
|
end
|
99
98
|
|
100
99
|
desc "validate the presence of .gitignore, adding it and any appropriate releasinator lines if necessary"
|
@@ -124,7 +123,7 @@ namespace :validate do
|
|
124
123
|
end
|
125
124
|
|
126
125
|
desc "run any configatron.custom_validation_methods"
|
127
|
-
task :custom => :config do
|
126
|
+
task :custom => [:config, :changelog] do
|
128
127
|
if @releasinator_config.has_key?(:custom_validation_methods)
|
129
128
|
@releasinator_config[:custom_validation_methods].each do |validate_method|
|
130
129
|
validate_method.call
|
@@ -173,28 +172,28 @@ end
|
|
173
172
|
namespace :local do
|
174
173
|
desc "ask user whether to proceed with release"
|
175
174
|
task :confirm do
|
176
|
-
Printer.check_proceed("You're about to release #{@
|
175
|
+
Printer.check_proceed("You're about to release #{@current_release.version}!", "Then no release for you!")
|
177
176
|
end
|
178
177
|
|
179
178
|
desc "change branch for git flow, if using git flow"
|
180
179
|
task :prepare => [:config, :"validate:changelog"] do
|
181
180
|
if use_git_flow()
|
182
|
-
CommandProcessor.command("git checkout -b release/#{@
|
181
|
+
CommandProcessor.command("git checkout -b release/#{@current_release.version} develop") unless GitUtil.get_current_branch() != "develop"
|
183
182
|
end
|
184
183
|
end
|
185
184
|
|
186
185
|
desc "tag the local repo"
|
187
186
|
task :tag => :config do
|
188
|
-
GitUtil.tag(@
|
187
|
+
GitUtil.tag(@current_release.version, @current_release.changelog)
|
189
188
|
end
|
190
189
|
|
191
190
|
desc "build the local repo"
|
192
191
|
task :build => [:config, :"validate:changelog", :prerelease_checklist, :confirm, :prepare, :tag] do
|
193
|
-
puts "building #{@
|
192
|
+
puts "building #{@current_release.version}" if @releasinator_config[:verbose]
|
194
193
|
@releasinator_config[:build_method].call
|
195
194
|
if @releasinator_config.has_key? :post_build_methods
|
196
195
|
@releasinator_config[:post_build_methods].each do |post_build_method|
|
197
|
-
post_build_method.call(@
|
196
|
+
post_build_method.call(@current_release.version)
|
198
197
|
end
|
199
198
|
end
|
200
199
|
end
|
@@ -204,15 +203,15 @@ namespace :local do
|
|
204
203
|
if use_git_flow()
|
205
204
|
CommandProcessor.command("git checkout master")
|
206
205
|
CommandProcessor.command("git pull")
|
207
|
-
CommandProcessor.command("git merge --no-ff release/#{@
|
208
|
-
GitUtil.delete_branch "release/#{@
|
206
|
+
CommandProcessor.command("git merge --no-ff release/#{@current_release.version}")
|
207
|
+
GitUtil.delete_branch "release/#{@current_release.version}"
|
209
208
|
CommandProcessor.command("git checkout develop")
|
210
209
|
CommandProcessor.command("git merge master")
|
211
210
|
CommandProcessor.command("git push origin develop --tags")
|
212
211
|
end
|
213
212
|
CommandProcessor.command("git push origin master --tags")
|
214
213
|
if @releasinator_config[:release_to_github]
|
215
|
-
Publisher.new(@releasinator_config).publish_draft(GitUtil.repo_url, @
|
214
|
+
Publisher.new(@releasinator_config).publish_draft(GitUtil.repo_url, @current_release)
|
216
215
|
end
|
217
216
|
end
|
218
217
|
end
|
@@ -223,12 +222,12 @@ namespace :pm do
|
|
223
222
|
|
224
223
|
desc "call configured publish_to_package_manager_method"
|
225
224
|
task :publish => [:config, :"validate:changelog"] do
|
226
|
-
@releasinator_config[:publish_to_package_manager_method].call(@
|
225
|
+
@releasinator_config[:publish_to_package_manager_method].call(@current_release.version)
|
227
226
|
end
|
228
227
|
|
229
228
|
desc "call configured wait_for_package_manager_method"
|
230
229
|
task :wait => [:config, :"validate:changelog"] do
|
231
|
-
@releasinator_config[:wait_for_package_manager_method].call(@
|
230
|
+
@releasinator_config[:wait_for_package_manager_method].call(@current_release.version)
|
232
231
|
end
|
233
232
|
end
|
234
233
|
|
@@ -299,7 +298,7 @@ namespace :downstream do
|
|
299
298
|
reset_repo(downstream_repo.branch)
|
300
299
|
|
301
300
|
if downstream_repo.options.has_key? :new_branch_name
|
302
|
-
new_branch_name = get_new_branch_name(downstream_repo.options[:new_branch_name], @
|
301
|
+
new_branch_name = get_new_branch_name(downstream_repo.options[:new_branch_name], @current_release.version)
|
303
302
|
GitUtil.delete_branch new_branch_name
|
304
303
|
end
|
305
304
|
end
|
@@ -324,7 +323,7 @@ namespace :downstream do
|
|
324
323
|
Dir.chdir(downstream_repo.name) do
|
325
324
|
|
326
325
|
if downstream_repo.options.has_key? :new_branch_name
|
327
|
-
new_branch_name = get_new_branch_name(downstream_repo.options[:new_branch_name], @
|
326
|
+
new_branch_name = get_new_branch_name(downstream_repo.options[:new_branch_name], @current_release.version)
|
328
327
|
CommandProcessor.command("git checkout -b #{new_branch_name}")
|
329
328
|
end
|
330
329
|
|
@@ -340,13 +339,13 @@ namespace :downstream do
|
|
340
339
|
# copy custom files
|
341
340
|
if downstream_repo.options.has_key? :files_to_copy
|
342
341
|
downstream_repo.options[:files_to_copy].each do |copy_file|
|
343
|
-
copy_the_file(root_dir, copy_file, @
|
342
|
+
copy_the_file(root_dir, copy_file, @current_release.version)
|
344
343
|
end
|
345
344
|
end
|
346
345
|
|
347
346
|
if downstream_repo.options.has_key? :post_copy_methods
|
348
347
|
downstream_repo.options[:post_copy_methods].each do |method|
|
349
|
-
method.call(@
|
348
|
+
method.call(@current_release.version)
|
350
349
|
end
|
351
350
|
end
|
352
351
|
|
@@ -358,9 +357,9 @@ namespace :downstream do
|
|
358
357
|
CommandProcessor.command("git add .")
|
359
358
|
CommandProcessor.command("git add -u .")
|
360
359
|
if downstream_repo.options.has_key? :new_branch_name
|
361
|
-
commit_message = "Update #{@releasinator_config[:product_name]} to #{@
|
360
|
+
commit_message = "Update #{@releasinator_config[:product_name]} to #{@current_release.version}"
|
362
361
|
else
|
363
|
-
commit_message = "Release #{@
|
362
|
+
commit_message = "Release #{@current_release.version}"
|
364
363
|
end
|
365
364
|
CommandProcessor.command("git commit -am \"#{commit_message}\"")
|
366
365
|
end
|
@@ -402,7 +401,7 @@ namespace :downstream do
|
|
402
401
|
Dir.chdir(DOWNSTREAM_REPOS) do
|
403
402
|
Dir.chdir(downstream_repo.name) do
|
404
403
|
# don't tag those where new branches are created
|
405
|
-
GitUtil.tag(@
|
404
|
+
GitUtil.tag(@current_release.version, @current_release.changelog) unless downstream_repo.options.has_key? :new_branch_name
|
406
405
|
end
|
407
406
|
end
|
408
407
|
end
|
@@ -420,12 +419,12 @@ namespace :downstream do
|
|
420
419
|
Dir.chdir(DOWNSTREAM_REPOS) do
|
421
420
|
Dir.chdir(downstream_repo.name) do
|
422
421
|
if downstream_repo.options.has_key? :new_branch_name
|
423
|
-
new_branch_name = get_new_branch_name(downstream_repo.options[:new_branch_name], @
|
422
|
+
new_branch_name = get_new_branch_name(downstream_repo.options[:new_branch_name], @current_release.version)
|
424
423
|
CommandProcessor.command("git push -u origin #{new_branch_name}")
|
425
|
-
Publisher.new(@releasinator_config).publish_pull_request(downstream_repo.url, @
|
424
|
+
Publisher.new(@releasinator_config).publish_pull_request(downstream_repo.url, @current_release, @releasinator_config[:product_name], downstream_repo.branch, new_branch_name)
|
426
425
|
else
|
427
426
|
CommandProcessor.command("git push origin master --tags")
|
428
|
-
Publisher.new(@releasinator_config).publish_draft(downstream_repo.url, @
|
427
|
+
Publisher.new(@releasinator_config).publish_draft(downstream_repo.url, @current_release) unless ! release_to_github(downstream_repo.options)
|
429
428
|
end
|
430
429
|
end
|
431
430
|
end
|
@@ -469,7 +468,7 @@ namespace :docs do
|
|
469
468
|
end
|
470
469
|
|
471
470
|
CommandProcessor.command("git add .")
|
472
|
-
CommandProcessor.command("git commit -m \"Update docs for release #{@
|
471
|
+
CommandProcessor.command("git commit -m \"Update docs for release #{@current_release.version}\"")
|
473
472
|
|
474
473
|
# switch back to previous branch
|
475
474
|
CommandProcessor.command("git checkout #{current_branch}")
|
data/releasinator.gemspec
CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.add_development_dependency "bundler", "~> 1.11"
|
30
30
|
spec.add_development_dependency "rake", "~> 11.1"
|
31
|
+
spec.add_development_dependency "test-unit", "~> 3.1"
|
31
32
|
|
32
33
|
spec.add_dependency "configatron", "~> 4.5"
|
33
34
|
spec.add_dependency "colorize", "~> 0.7"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: releasinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PayPal
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '11.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: test-unit
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.1'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: configatron
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|