semmy 1.1.0 → 1.2.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
  SHA256:
3
- metadata.gz: 3593823ef6863af335da8379285319b3bfcef4ca60b8130ccb1ff98633694c3f
4
- data.tar.gz: bf08cbcca120b4e42792fe66ba370f751a92712c033b415f28f45814de76d1b1
3
+ metadata.gz: 4a9c4378a310880351973ba7495052ba8732629137915052be599823e74436c5
4
+ data.tar.gz: f3225ce6b30493cd39ca8b53a1751367874bb4cc195944eaeefd9c8b3881f31d
5
5
  SHA512:
6
- metadata.gz: 2f1a2f9f3476e805531cdf4b15db7d9cb7b8fcc589f88db711ae58a7e86f0cb8626047ee563de135b1fb35d733705e3f0eb37de65ed4f130a9545642497d2981
7
- data.tar.gz: 1b936d088d33fdeb0d6c0c09caee081d6072784ee7fc16d4622555eba5ce1630d4d731884cef94bd53f16c9c80127581ca6cb75487a7bb99137e24b267128a6b
6
+ metadata.gz: bdc2c3cb16604b4204a69de93c0b6d362487d743943e7d8da4bb40073fc4efcdef4d00b1fabf75a5311966edcd884607fcaf310545842a38f76a3517592fcfd4
7
+ data.tar.gz: 3ca48dbd6d46c1ef27c493f0d45404344ee13bbb6a2258029ecf6dea8eed8bc7d462f7a7051380ccf59f3bff041038c7b4b6c75ae32819ad7b6b08cb649cd1bb
@@ -1,17 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
- ### Version 1.1.0
3
+ ### Version 1.2.0
4
4
 
5
- 2019-01-23
5
+ 2019-01-24
6
6
 
7
- [Compare changes](https://github.com/tf/semmy/compare/1-0-stable...v1.1.0)
7
+ [Compare changes](https://github.com/tf/semmy/compare/1-1-stable...v1.2.0)
8
8
 
9
- - Run same tasks as on `master` when running on major version stable
10
- branch (e.g. `2-x-stable`).
11
-
12
- - Bug fix: Ensure test install of gem during `release:prepare` does not hang
13
- waiting for interactive input on uninstall.
9
+ - Add config option to automatically push branches after release.
14
10
 
15
11
  See
16
- [1-0-stable branch](https://github.com/tf/semmy/blob/1-0-stable/CHANGELOG.md)
12
+ [1-1-stable branch](https://github.com/tf/semmy/blob/1-1-stable/CHANGELOG.md)
17
13
  for previous changes.
data/README.md CHANGED
@@ -67,6 +67,15 @@ Add the tasks to your Rakefile:
67
67
 
68
68
  Semmy::Tasks.install
69
69
 
70
+ You can pass config options:
71
+
72
+ # Rakefile
73
+ require 'semmy'
74
+
75
+ Semmy::Tasks.install do |config|
76
+ # see Semmy::Configuration for options
77
+ end
78
+
70
79
  ## Usage
71
80
 
72
81
  Semmy defines a new task to prepare a release:
@@ -100,6 +109,22 @@ The resulting commit graph looks like:
100
109
  * (v1.2.0, 1-2-stable) Prepare 1.2.0 release
101
110
  * Some new feature
102
111
 
112
+ By default, the new stable branch and the bump commit are not pushed
113
+ automatically. This can be activated by setting the
114
+ `push_branches_after_release` config option to `true`.
115
+
116
+ This will be the new default once Semmy 2.0 is released. You can opt
117
+ into the future default behavior globally without changing config
118
+ options on the project level by setting the
119
+ `SEMMY_PUSH_BRANCHES_AFTER_RELEASE` environment variable to `on`.
120
+
121
+ Branches will be pushed to the remote passed as an argument to the
122
+ `release` task:
123
+
124
+ $ rake release[upstream]
125
+
126
+ By default, branches are pushed to `origin`.
127
+
103
128
  ### Releasing a Patch Level Version
104
129
 
105
130
  Assume an important bug fix has been added to `master`:
@@ -3,6 +3,7 @@ module Semmy
3
3
  attr_accessor :development_version_suffix
4
4
 
5
5
  attr_accessor :stable_branch_name
6
+ attr_accessor :push_branches_after_release
6
7
 
7
8
  attr_accessor :prepare_commit_message
8
9
  attr_accessor :bump_commit_message
@@ -25,6 +26,7 @@ module Semmy
25
26
  @development_version_suffix = 'dev'
26
27
 
27
28
  @stable_branch_name = '%{major}-%{minor}-stable'
29
+ @push_branches_after_release = ENV['SEMMY_PUSH_BRANCHES_AFTER_RELEASE'] == 'on'
28
30
 
29
31
  @prepare_commit_message = 'Prepare %{version} release'
30
32
  @bump_commit_message = 'Bump version to %{version}'
@@ -49,22 +49,24 @@ module Semmy
49
49
  end
50
50
  end
51
51
 
52
- task 'release:after:master' => [
52
+ task 'release:after:master', [:remote] => [
53
53
  'semmy:branches:create_stable',
54
54
  'semmy:versioning:bump_minor',
55
55
  'semmy:changelog:update_for_minor',
56
- 'semmy:commit:bump'
56
+ 'semmy:commit:bump',
57
+ 'semmy:branches:push_master',
58
+ 'semmy:branches:push_previous_stable'
57
59
  ]
58
60
 
59
61
  desc 'Prepare repository for development of next verion'
60
- task 'release:after' do
62
+ task 'release:after', [:remote] do |_, args|
61
63
  if Scm.on_master? || Scm.on_major_version_stable?(config.stable_branch_name)
62
- Rake.application['release:after:master'].invoke
64
+ Rake.application['release:after:master'].invoke(args[:remote])
63
65
  end
64
66
  end
65
67
 
66
- task 'release' do
67
- Rake.application['release:after'].invoke
68
+ task 'release', [:remote] do |_, args|
69
+ Rake.application['release:after'].invoke(args[:remote])
68
70
  end
69
71
 
70
72
  task 'bump:patch' => [
@@ -6,19 +6,47 @@ module Semmy
6
6
  def define
7
7
  namespace 'branches' do
8
8
  task 'create_stable' do
9
- name = config.stable_branch_name %
10
- VersionString.components(Project.version)
9
+ Shell.info("Creating stable branch #{stable_branch_name}.")
11
10
 
12
- Shell.info("Creating stable branch #{name}.")
11
+ git.branch(stable_branch_name).create
12
+ end
13
+
14
+ task 'push_master', [:remote] do |_, args|
15
+ push_branch(args[:remote], 'master')
16
+ end
13
17
 
14
- git.branch(name).create
18
+ task 'push_previous_stable', [:remote] do |_, args|
19
+ push_branch(args[:remote], previous_stable_branch_name)
15
20
  end
16
21
  end
22
+ end
23
+
24
+ private
25
+
26
+ def stable_branch_name
27
+ VersionString.stable_branch_name(Project.version,
28
+ config.stable_branch_name)
29
+ end
30
+
31
+ def previous_stable_branch_name
32
+ VersionString.previous_stable_branch_name(Project.version,
33
+ config.stable_branch_name)
34
+ end
17
35
 
18
- def git
19
- Git.open('.')
36
+ def push_branch(remote, name)
37
+ remote ||= 'origin'
38
+
39
+ if config.push_branches_after_release
40
+ Shell.info("Pushing #{name} to #{remote}.")
41
+ git.push(remote, name)
42
+ else
43
+ Shell.info("NOTE: Remember to push #{name} to #{remote}.")
20
44
  end
21
45
  end
46
+
47
+ def git
48
+ Git.open('.')
49
+ end
22
50
  end
23
51
  end
24
52
  end
@@ -1,3 +1,3 @@
1
1
  module Semmy
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
@@ -62,6 +62,10 @@ module Semmy
62
62
  components.join('.')
63
63
  end
64
64
 
65
+ def stable_branch_name(version, stable_branch_name_pattern)
66
+ stable_branch_name_pattern % VersionString.components(version)
67
+ end
68
+
65
69
  def previous_stable_branch_name(version, stable_branch_name_pattern)
66
70
  stable_branch_name_pattern % previous_minor_version_components(version)
67
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semmy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Fischbach
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-23 00:00:00.000000000 Z
11
+ date: 2019-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git