releasinator 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13f6f9c34a097f3dcb68bd15c8df1501f190a482
4
- data.tar.gz: 6860c893ba8ddf2efe8d1011473afe3309f42e5f
3
+ metadata.gz: cfcb0c0860fd15ef1e4ece2155302b634699dcc2
4
+ data.tar.gz: 8aa056a5a1f092e7ac2fafb183b73061bce4e666
5
5
  SHA512:
6
- metadata.gz: 91891918d99e27b46e1c88d0de701d3d90f312a356c9c910d5d04fda7260efdca1331ae2d1d096406a74e82f392160a6ffd11e127a1984bd614f42d37b6d567e
7
- data.tar.gz: bc6aca918ee4cf5a4c5265f706f53a92c8a3910b315198ddfe8b973b8df654d1953b0dad2ab986dd9cfa8b1199be08f2eae436a645c6af2ecaa49f5e963aa36c
6
+ metadata.gz: 6e519b13c6301ede333d82afa4d2a3216cb785000802c1e1b7b3cecdd20f63183d4de46fc34bd4c980b20846555b6bd158f5e1b420d7130083d361c14f00965a
7
+ data.tar.gz: efb92b51475f46d51892ea3598af803827fea3555131fcff533ad2387efc6cd7455fa96c90541c199121f6fce103f6de68985f9b7f8a65f8a7f4606273c4f3a6
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  build
2
+ .DS_Store
data/.releasinator.rb CHANGED
@@ -46,7 +46,7 @@ def build_method
46
46
  CommandProcessor.command("mv releasinator-*.gem #{output_dir}")
47
47
  end
48
48
 
49
- # The command that builds the sdk. Required.
49
+ # The command that builds the project. Required.
50
50
  configatron.build_method = method(:build_method)
51
51
 
52
52
  def publish_to_package_manager(version)
@@ -56,7 +56,7 @@ def publish_to_package_manager(version)
56
56
  end
57
57
  end
58
58
 
59
- # The method that publishes the sdk to the package manager. Required.
59
+ # The method that publishes the project to the package manager. Required.
60
60
  configatron.publish_to_package_manager_method = method(:publish_to_package_manager)
61
61
 
62
62
 
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Releasinator release notes
2
2
  ==========================
3
3
 
4
+ 0.5.0
5
+ -----
6
+ * The releasinator is now Open Source!
7
+ * Validate `.gitignore` includes `.DS_Store`.
8
+
4
9
  0.4.1
5
10
  -----
6
11
  * `release_to_github` will now create a new release (instead of a draft).
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- releasinator (0.4.1)
4
+ releasinator (0.5.0)
5
5
  colorize (~> 0.7)
6
6
  configatron (~> 4.5)
7
7
  json (~> 1.8)
@@ -23,13 +23,13 @@ GEM
23
23
  octokit (4.3.0)
24
24
  sawyer (~> 0.7.0, >= 0.5.3)
25
25
  power_assert (0.3.0)
26
- rake (11.1.2)
26
+ rake (11.2.2)
27
27
  redcarpet (3.3.4)
28
28
  sawyer (0.7.0)
29
29
  addressable (>= 2.3.5, < 2.5)
30
30
  faraday (~> 0.8, < 0.10)
31
31
  semantic (1.4.1)
32
- test-unit (3.1.8)
32
+ test-unit (3.2.0)
33
33
  power_assert
34
34
  vandamme (0.0.11)
35
35
  github-markup (~> 1.3)
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Problem
6
6
 
7
- When automating an SDK release process, many teams and languages have different ideas. The release process is a hurdle that makes it hard for new project members to ramp up. One shouldn't have to read a `release_process.md` to release an open source SDK.
7
+ When automating a release process for libraries, SDKs, apps, or other open source projects, many teams have different ideas. This is on top of the fact that each language has its own conventions and repositories for distributing packages. The release process is a hurdle that makes it hard for new project members to ramp up. One shouldn't have to read a `release_process.md` to release an open source project.
8
8
 
9
9
  ## Solution
10
10
 
@@ -77,14 +77,14 @@ release
77
77
 
78
78
  ### Config
79
79
 
80
- A default config file is created when running any releasinator rake task for the first time. This file includes placeholders for all the mandatory config items. Below is the full list of config options.
80
+ A [default config file](lib/default_config.rb) is created when running any releasinator rake task for the first time. This file includes placeholders for all the mandatory config items. Below is the full list of config options.
81
81
 
82
82
  #### Required `.releasinator.rb` config options:
83
83
 
84
- 1. `configatron.product_name`: The name of the sdk for usage in various commit statements.
84
+ 1. `configatron.product_name`: The name of the project for usage in various commit statements.
85
85
  2. `configatron.prerelease_checklist_items`: List of items to confirm from the person releasing.
86
- 3. `configatron.build_method`: The command that builds the sdk.
87
- 4. `configatron.publish_to_package_manager_method`: The method that publishes the sdk to the package manager.
86
+ 3. `configatron.build_method`: The command that builds the project.
87
+ 4. `configatron.publish_to_package_manager_method`: The method that publishes the project to the package manager.
88
88
  5. `configatron.wait_for_package_manager_method`: The method that waits for the package manager to be done.
89
89
  6. `configatron.release_to_github`: True if publishing the root repo to GitHub.
90
90
 
@@ -98,6 +98,16 @@ A default config file is created when running any releasinator rake task for the
98
98
  6. `configatron.doc_target_dir`: The directory where to run all git commands when publishing the docs. If not specified, the default is `.`. Generally useful if the docs are only applicable on a downstream release, rather than on the source itself.
99
99
  7. `configatron.doc_files_to_copy`: List of CopyFile objects for copying built docs into a targeted location. Please see documentation on the `CopyFile` class.
100
100
 
101
+ #### Appending existing tasks in the releasinator lifecycle:
102
+
103
+ In some cases, releasing a project may require a deviation from the task lifecycle. To deal with this without requiring an update to the releasinator, you may just append an existing task in your project's config file. For example:
104
+
105
+ ```
106
+ task :"validate:changelog" do
107
+ puts "validating changelog complete, let's dance!".red
108
+ end
109
+ ```
110
+ This will 'append' the task `validate:changelog`, running the code block after the official releasinator task contents have run. See [this blog post](http://www.dan-manges.com/blog/modifying-rake-tasks) for a detailed description of how this mechanism works. You may append a task more than once.
101
111
 
102
112
  ## Conventions
103
113
 
data/Rakefile CHANGED
@@ -1 +1 @@
1
- import "./lib/tasks/releasinator.rake"
1
+ import "./lib/tasks/releasinator.rake"
@@ -56,4 +56,4 @@ module Releasinator
56
56
  Printer.success("Returned non-empty output.")
57
57
  end
58
58
  end
59
- end
59
+ end
data/lib/config_hash.rb CHANGED
@@ -56,4 +56,4 @@ module Releasinator
56
56
  '.'
57
57
  end
58
58
  end
59
- end
59
+ end
data/lib/copy_file.rb CHANGED
@@ -10,4 +10,4 @@ module Releasinator
10
10
  @target_dir.freeze
11
11
  end
12
12
  end
13
- end
13
+ end
@@ -8,4 +8,4 @@ module Releasinator
8
8
  @changelog.freeze
9
9
  end
10
10
  end
11
- end
11
+ end
@@ -11,14 +11,14 @@ def build_method
11
11
  abort("please implement build_method method")
12
12
  end
13
13
 
14
- # The command that builds the sdk. Required.
14
+ # The command that builds the project. Required.
15
15
  configatron.build_method = method(:build_method)
16
16
 
17
17
  def publish_to_package_manager(version)
18
18
  abort("please implement publish_to_package_manager method")
19
19
  end
20
20
 
21
- # The method that publishes the sdk to the package manager. Required.
21
+ # The method that publishes the project to the package manager. Required.
22
22
  configatron.publish_to_package_manager_method = method(:publish_to_package_manager)
23
23
 
24
24
 
@@ -30,4 +30,4 @@ configatron.wait_for_package_manager_method = method(:wait_for_package_manager)
30
30
 
31
31
  # True if publishing the root repo to GitHub. Required.
32
32
  configatron.release_to_github = true
33
- )
33
+ )
data/lib/downstream.rb CHANGED
@@ -67,7 +67,7 @@ module Releasinator
67
67
  # remove old everything
68
68
  CommandProcessor.command("rm -rf *")
69
69
 
70
- # update all sdk files
70
+ # update all distribution files
71
71
  CommandProcessor.command("rsync -av --exclude='#{DOWNSTREAM_REPOS}' --exclude='.git/' #{copy_from_dir}/* .")
72
72
  CommandProcessor.command("rsync -av --exclude='#{DOWNSTREAM_REPOS}' --exclude='.git/' #{copy_from_dir}/.[!.]* .")
73
73
  end
@@ -28,4 +28,4 @@ module Releasinator
28
28
  false
29
29
  end
30
30
  end
31
- end
31
+ end
data/lib/git_util.rb CHANGED
@@ -124,4 +124,4 @@ module Releasinator
124
124
  end
125
125
  end
126
126
  end
127
- end
127
+ end
data/lib/github_repo.rb CHANGED
@@ -47,4 +47,4 @@ module Releasinator
47
47
  end
48
48
  end
49
49
  end
50
- end
50
+ end
data/lib/printer.rb CHANGED
@@ -18,4 +18,4 @@ module Releasinator
18
18
  end
19
19
  end
20
20
  end
21
- end
21
+ end
data/lib/publisher.rb CHANGED
@@ -26,6 +26,18 @@ module Releasinator
26
26
  end
27
27
  end
28
28
 
29
+ def upload_asset(repo_url, release, path_or_file, content_type)
30
+ begin
31
+ github_repo = GitHubRepo.new(repo_url)
32
+ github_release = github_repo.client.release_for_tag "#{github_repo.org}/#{github_repo.repo}", release.version
33
+ github_repo.client.upload_asset github_release.url, path_or_file, :content_type => content_type
34
+ rescue => error
35
+ #This will fail if it cannot upload the files
36
+ Printer.fail(error.inspect)
37
+ abort()
38
+ end
39
+ end
40
+
29
41
  def publish_pull_request(repo_url, release, product_name, base, head)
30
42
  begin
31
43
  github_repo = GitHubRepo.new(repo_url)
@@ -1,3 +1,3 @@
1
1
  module Releasinator
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -87,6 +87,7 @@ namespace :validate do
87
87
  task :gitignore => :config do
88
88
  @validator.validate_exist('.', ".gitignore", DOWNSTREAM_REPOS)
89
89
  @validator.validate_exist(@releasinator_config.base_dir, ".gitignore", DOWNSTREAM_REPOS) if '.' != @releasinator_config.base_dir
90
+ @validator.validate_gitignore_contents(".DS_Store")
90
91
  if @releasinator_config.has_key?(:downstream_repos)
91
92
  @validator.validate_gitignore_contents("#{DOWNSTREAM_REPOS}/")
92
93
  end
data/lib/validator.rb CHANGED
@@ -140,16 +140,13 @@ module Releasinator
140
140
  if !line_match_in_file?(line, ".gitignore")
141
141
  is_git_already_clean = GitUtil.is_clean_git?
142
142
  File.open('.gitignore', 'a') do |f|
143
- f.puts "# #{@releasinator_config[:releasinator_name]}"
144
143
  f.puts line
145
144
  end
146
145
 
146
+ Printer.success("Added missing line '#{line}' to .gitignore.")
147
+
147
148
  if is_git_already_clean
148
- CommandProcessor.command("git add . && git commit -m \"#{@releasinator_config[:releasinator_name]}: add downstream dir to .gitignore\"")
149
- Printer.success("Added downstream dir to .gitignore file.")
150
- else
151
- Printer.fail("Added downstream dir to .gitignore file, but there are other changes in the workspace. Please commit and continue.")
152
- abort()
149
+ CommandProcessor.command("git add . && git commit -m \"#{@releasinator_config[:releasinator_name]}: add missing line to .gitignore\"")
153
150
  end
154
151
  end
155
152
  end
@@ -98,4 +98,4 @@ module Releasinator
98
98
  CurrentRelease.new(latest_release, latest_release_changelog)
99
99
  end
100
100
  end
101
- end
101
+ end
data/releasinator.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Releasinator::VERSION
9
9
  spec.authors = ["PayPal"]
10
10
  spec.email = ["DL-PP-RUBY-SDK@paypal.com"]
11
- spec.summary = %q{The releasinator assists in building and releasing SDKs across languages.}
12
- spec.description = %q{The releasinator assists in building and releasing SDKs across languages.}
11
+ spec.summary = %q{The releasinator assists in building and releasing open source projects.}
12
+ spec.description = %q{The releasinator assists in building and releasing open source projects.}
13
13
  spec.homepage = "https://developer.paypal.com"
14
14
  spec.license = "Apache-2.0"
15
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: releasinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PayPal
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-16 00:00:00.000000000 Z
11
+ date: 2016-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '4.0'
139
- description: The releasinator assists in building and releasing SDKs across languages.
139
+ description: The releasinator assists in building and releasing open source projects.
140
140
  email:
141
141
  - DL-PP-RUBY-SDK@paypal.com
142
142
  executables: []
@@ -193,5 +193,5 @@ rubyforge_project:
193
193
  rubygems_version: 2.5.1
194
194
  signing_key:
195
195
  specification_version: 4
196
- summary: The releasinator assists in building and releasing SDKs across languages.
196
+ summary: The releasinator assists in building and releasing open source projects.
197
197
  test_files: []