fastlane-plugin-semantic_convention_release 1.0.3 → 1.0.4

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: 2ace8838446cea5cae1fd1453dc20a21c686f828275693993e97d8b8e38575a6
4
- data.tar.gz: 8b2b68a4ea3c35fe1a3f2b71fb811b81e48ff5ccc74c615f2e8bf050e0574276
3
+ metadata.gz: d9f08f67b8b80e5f8c29eb96074ee4f7d3e89dd52173387ad893226f7bb32bea
4
+ data.tar.gz: 71b952d8c07eeae2b912377538ebc89cc02ba8f8b9cab3d253f75f2471dca3e0
5
5
  SHA512:
6
- metadata.gz: 574701ed2c8e79ca07fdff7ba8c04998794b025fe5d838966ef12dc97303977991738aa849e96ec3c1cf9950a632692680dc8d875f03c73fd83b1f77af8d5a7a
7
- data.tar.gz: 4418b9838fa94536915685e1428ec717c92400f1cc8fc2a0007f488782a0274aaf84dcb96b6bddb054d1d383da43356125cfd992d357a0c35721aebc9c3f7aec
6
+ metadata.gz: 488d021f6ce7c90b38fc7e9125b1e20819052eaa5f0f5b8a2dc7d30b35706804ca20c6cb37af2108c98935c437733dd9cf4e2e587b76df9c1ee31e2ad9282e81
7
+ data.tar.gz: 7b94d57a123309940683949fb93dd48b8ccd9999a6ae8b15fbe2626107e8fc534a0ce10528e1f974cdd166a1e27118ffdb4d6360591771fe480e30d108e60447
@@ -91,6 +91,10 @@ module Fastlane
91
91
  releases = params[:releases]
92
92
 
93
93
  format_pattern = lane_context[SharedValues::CONVENTIONAL_CHANGELOG_ACTION_FORMAT_PATTERN]
94
+
95
+ patch_updated = false
96
+ minor_updated = false
97
+ major_updated = false
94
98
  splitted.each do |line|
95
99
  parts = line.split("|")
96
100
  subject = parts[0].strip
@@ -111,15 +115,18 @@ module Fastlane
111
115
  next if scopes_to_ignore.include?(scope) #=> true
112
116
  end
113
117
 
114
- if commit[:release] == "major" || commit[:is_breaking_change]
118
+ if (commit[:release] == "major" || commit[:is_breaking_change]) && !major_updated
115
119
  next_major += 1
116
120
  next_minor = 0
117
121
  next_patch = 0
118
- elsif commit[:release] == "minor"
122
+ major_updated = true
123
+ elsif commit[:release] == "minor" && !major_updated && !minor_updated
119
124
  next_minor += 1
120
125
  next_patch = 0
121
- elsif commit[:release] == "patch"
126
+ minor_updated = minor_updated
127
+ elsif commit[:release] == "patch" && !major_updated && !minor_updated && !patch_updated
122
128
  next_patch += 1
129
+ patch_updated = true
123
130
  end
124
131
 
125
132
  next_version = "#{next_major}.#{next_minor}.#{next_patch}"
@@ -127,7 +134,6 @@ module Fastlane
127
134
  end
128
135
 
129
136
  next_version = "#{next_major}.#{next_minor}.#{next_patch}"
130
-
131
137
  is_next_version_releasable = Helper::SemanticConventionReleaseHelper.semver_gt(next_version, version)
132
138
 
133
139
  Actions.lane_context[SharedValues::RELEASE_ANALYZED] = true
@@ -171,7 +177,9 @@ module Fastlane
171
177
  )
172
178
  releases = params[:releases]
173
179
  codepush_friendly = params[:codepush_friendly]
174
-
180
+ patch_updated = false
181
+ minor_updated = false
182
+ major_updated = false
175
183
  format_pattern = lane_context[SharedValues::CONVENTIONAL_CHANGELOG_ACTION_FORMAT_PATTERN]
176
184
  splitted.each do |line|
177
185
  # conventional commits are in format
@@ -184,15 +192,18 @@ module Fastlane
184
192
  codepush_friendly: codepush_friendly
185
193
  )
186
194
 
187
- if commit[:release] == "major" || commit[:is_breaking_change]
195
+ if (commit[:release] == "major" || commit[:is_breaking_change]) && !major_updated
188
196
  next_major += 1
189
197
  next_minor = 0
190
198
  next_patch = 0
191
- elsif commit[:release] == "minor"
199
+ major_updated = true
200
+ elsif commit[:release] == "minor" && !major_updated && !minor_updated
192
201
  next_minor += 1
193
202
  next_patch = 0
194
- elsif commit[:release] == "patch"
203
+ minor_updated = true
204
+ elsif commit[:release] == "patch" && !major_updated && !minor_updated && !patch_updated
195
205
  next_patch += 1
206
+ patch_updated = true
196
207
  end
197
208
 
198
209
  unless commit[:is_codepush_friendly]
@@ -258,13 +269,13 @@ module Fastlane
258
269
  FastlaneCore::ConfigItem.new(
259
270
  key: :releases,
260
271
  description: "Map types of commit to release (major, minor, patch)",
261
- default_value: { fix: "patch", feat: "minor" },
272
+ default_value: { fix: "patch", feat: "minor", BREAKING_CHANGE: "major" },
262
273
  type: Hash
263
274
  ),
264
275
  FastlaneCore::ConfigItem.new(
265
276
  key: :codepush_friendly,
266
277
  description: "These types are consider as codepush friendly automatically",
267
- default_value: ["chore", "test", "docs"],
278
+ default_value: ["chore", "test", "docs", "style", "refactor", "perf"],
268
279
  type: Array,
269
280
  optional: true
270
281
  ),
@@ -276,7 +287,7 @@ module Fastlane
276
287
  FastlaneCore::ConfigItem.new(
277
288
  key: :ignore_scopes,
278
289
  description: "To ignore certain scopes when calculating releases",
279
- default_value: [],
290
+ default_value: ["skip"],
280
291
  type: Array,
281
292
  optional: true
282
293
  ),
@@ -231,7 +231,7 @@ module Fastlane
231
231
  FastlaneCore::ConfigItem.new(
232
232
  key: :order,
233
233
  description: "You can change the order of groups in release notes",
234
- default_value: ["feat", "fix", "refactor", "perf", "chore", "test", "docs", "style", "no_type"],
234
+ default_value: ["feat", "fix", "refactor", "perf", "chore", "test", "docs", "style"],
235
235
  type: Array,
236
236
  optional: true
237
237
  ),
@@ -246,8 +246,7 @@ module Fastlane
246
246
  chore: "Building system",
247
247
  test: "Testing",
248
248
  docs: "Documentation",
249
- style: "Code style",
250
- no_type: "Other work"
249
+ style: "Code style"
251
250
  },
252
251
  type: Hash,
253
252
  optional: true
@@ -7,7 +7,7 @@ module Fastlane
7
7
  class SemanticConventionReleaseHelper
8
8
  def self.format_patterns
9
9
  return {
10
- "default" => /^(docs|fix|feat|chore|style|refactor|perf|test|skip)(?:\((.*)\))?(!?)\: (.*)/,
10
+ "default" => /^(docs|fix|feat|chore|style|refactor|perf|test)(?:\((.*)\))?(!?)\: (.*)/,
11
11
  "angular" => /^(\w*)(?:\((.*)\))?(): (.*)/
12
12
  }
13
13
  end
@@ -1 +1 @@
1
- module Fastlane module SemanticConventionRelease VERSION = "1.0.3" end end
1
+ module Fastlane module SemanticConventionRelease VERSION = "1.0.4" end end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-semantic_convention_release
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jiří Otáhal
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-08-31 00:00:00.000000000 Z
12
+ date: 2020-09-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry