fastlane-plugin-semantic_release 1.11.0 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastlane/plugin/semantic_release/actions/analyze_commits.rb +29 -2
- data/lib/fastlane/plugin/semantic_release/actions/conventional_changelog.rb +3 -1
- data/lib/fastlane/plugin/semantic_release/helper/semantic_release_helper.rb +11 -4
- data/lib/fastlane/plugin/semantic_release/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 801ae7e90c09769c435f3aa1640323338ff7b343d3005427208f371f2cd06711
|
4
|
+
data.tar.gz: '0790c9a548fd4d4bd59409bf659b488af3db65cfb098683dac62658b36b866c4'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8527660760ffa383de7ff51baa708323da17ed33a7d601becc88375f4ad789ee6d4b99970995b42ae010a6a8f976b661fd53c22dd522bef8d0df30d3fc091bd
|
7
|
+
data.tar.gz: 6935fab5c02ffa2cb63d6d5fde4a7012e4abd800263059265c75c2f29155d179af8a960e11ebb146a329cc6c7af44ae52dc8718da04ba1b7309a566fc80767c8
|
@@ -13,6 +13,7 @@ module Fastlane
|
|
13
13
|
RELEASE_NEXT_PATCH_VERSION = :RELEASE_NEXT_PATCH_VERSION
|
14
14
|
RELEASE_NEXT_VERSION = :RELEASE_NEXT_VERSION
|
15
15
|
RELEASE_LAST_INCOMPATIBLE_CODEPUSH_VERSION = :RELEASE_LAST_INCOMPATIBLE_CODEPUSH_VERSION
|
16
|
+
CONVENTIONAL_CHANGELOG_ACTION_FORMAT_PATTERN = :CONVENTIONAL_CHANGELOG_ACTION_FORMAT_PATTERN
|
16
17
|
end
|
17
18
|
|
18
19
|
class AnalyzeCommitsAction < Action
|
@@ -89,6 +90,7 @@ module Fastlane
|
|
89
90
|
UI.message("Found #{splitted.length} commits since last release")
|
90
91
|
releases = params[:releases]
|
91
92
|
|
93
|
+
format_pattern = lane_context[SharedValues::CONVENTIONAL_CHANGELOG_ACTION_FORMAT_PATTERN]
|
92
94
|
splitted.each do |line|
|
93
95
|
parts = line.split("|")
|
94
96
|
subject = parts[0].strip
|
@@ -97,7 +99,8 @@ module Fastlane
|
|
97
99
|
commit = Helper::SemanticReleaseHelper.parse_commit(
|
98
100
|
commit_subject: subject,
|
99
101
|
commit_body: parts[1],
|
100
|
-
releases: releases
|
102
|
+
releases: releases,
|
103
|
+
pattern: format_pattern
|
101
104
|
)
|
102
105
|
|
103
106
|
unless commit[:scope].nil?
|
@@ -169,6 +172,7 @@ module Fastlane
|
|
169
172
|
releases = params[:releases]
|
170
173
|
codepush_friendly = params[:codepush_friendly]
|
171
174
|
|
175
|
+
format_pattern = lane_context[SharedValues::CONVENTIONAL_CHANGELOG_ACTION_FORMAT_PATTERN]
|
172
176
|
splitted.each do |line|
|
173
177
|
# conventional commits are in format
|
174
178
|
# type: subject (fix: app crash - for example)
|
@@ -176,6 +180,7 @@ module Fastlane
|
|
176
180
|
commit_subject: line.split("|")[0],
|
177
181
|
commit_body: line.split("|")[1],
|
178
182
|
releases: releases,
|
183
|
+
pattern: format_pattern,
|
179
184
|
codepush_friendly: codepush_friendly
|
180
185
|
)
|
181
186
|
|
@@ -229,6 +234,27 @@ module Fastlane
|
|
229
234
|
UI.user_error!("No match for analyze_commits action given, pass using `match: 'expr'`") unless value && !value.empty?
|
230
235
|
end
|
231
236
|
),
|
237
|
+
FastlaneCore::ConfigItem.new(
|
238
|
+
key: :commit_format,
|
239
|
+
description: "The commit format to apply. Presets are 'default' or 'angular', or you can provide your own Regexp. Note: the supplied regex _must_ have 4 capture groups, in order: type, scope, has_exclamation_mark, and subject",
|
240
|
+
default_value: "default",
|
241
|
+
is_string: false,
|
242
|
+
verify_block: proc do |value|
|
243
|
+
case value
|
244
|
+
when String
|
245
|
+
unless Helper::SemanticReleaseHelper.format_patterns.key?(value)
|
246
|
+
UI.user_error!("Invalid format preset: #{value}")
|
247
|
+
end
|
248
|
+
|
249
|
+
pattern = Helper::SemanticReleaseHelper.format_patterns[value]
|
250
|
+
when Regexp
|
251
|
+
pattern = value
|
252
|
+
else
|
253
|
+
UI.user_error!("Invalid option type: #{value.inspect}")
|
254
|
+
end
|
255
|
+
Actions.lane_context[SharedValues::CONVENTIONAL_CHANGELOG_ACTION_FORMAT_PATTERN] = pattern
|
256
|
+
end
|
257
|
+
),
|
232
258
|
FastlaneCore::ConfigItem.new(
|
233
259
|
key: :releases,
|
234
260
|
description: "Map types of commit to release (major, minor, patch)",
|
@@ -283,7 +309,8 @@ module Fastlane
|
|
283
309
|
['RELEASE_NEXT_MINOR_VERSION', 'Minor number of the next version'],
|
284
310
|
['RELEASE_NEXT_PATCH_VERSION', 'Patch number of the next version'],
|
285
311
|
['RELEASE_NEXT_VERSION', 'Next version string in format (major.minor.patch)'],
|
286
|
-
['RELEASE_LAST_INCOMPATIBLE_CODEPUSH_VERSION', 'Last commit without codepush']
|
312
|
+
['RELEASE_LAST_INCOMPATIBLE_CODEPUSH_VERSION', 'Last commit without codepush'],
|
313
|
+
['CONVENTIONAL_CHANGELOG_ACTION_FORMAT_PATTERN', 'The format pattern Regexp used to match commits (mainly for internal use)']
|
287
314
|
]
|
288
315
|
end
|
289
316
|
|
@@ -175,12 +175,14 @@ module Fastlane
|
|
175
175
|
def self.parse_commits(commits)
|
176
176
|
parsed = []
|
177
177
|
# %s|%b|%H|%h|%an|%at
|
178
|
+
format_pattern = lane_context[SharedValues::CONVENTIONAL_CHANGELOG_ACTION_FORMAT_PATTERN]
|
178
179
|
commits.each do |line|
|
179
180
|
splitted = line.split("|")
|
180
181
|
|
181
182
|
commit = Helper::SemanticReleaseHelper.parse_commit(
|
182
183
|
commit_subject: splitted[0],
|
183
|
-
commit_body: splitted[1]
|
184
|
+
commit_body: splitted[1],
|
185
|
+
pattern: format_pattern
|
184
186
|
)
|
185
187
|
|
186
188
|
commit[:hash] = splitted[2]
|
@@ -5,6 +5,13 @@ module Fastlane
|
|
5
5
|
|
6
6
|
module Helper
|
7
7
|
class SemanticReleaseHelper
|
8
|
+
def self.format_patterns
|
9
|
+
return {
|
10
|
+
"default" => /^(docs|fix|feat|chore|style|refactor|perf|test)(?:\((.*)\))?(!?)\: (.*)/,
|
11
|
+
"angular" => /^(\w*)(?:\((.*)\))?(): (.*)/
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
8
15
|
# class methods that you define here become available in your action
|
9
16
|
# as `Helper::SemanticReleaseHelper.your_method`
|
10
17
|
#
|
@@ -18,7 +25,7 @@ module Fastlane
|
|
18
25
|
commit_body = params[:commit_body]
|
19
26
|
releases = params[:releases]
|
20
27
|
codepush_friendly = params[:codepush_friendly]
|
21
|
-
pattern =
|
28
|
+
pattern = params[:pattern]
|
22
29
|
breaking_change_pattern = /BREAKING CHANGES?: (.*)/
|
23
30
|
codepush_pattern = /codepush?: (.*)/
|
24
31
|
|
@@ -32,13 +39,13 @@ module Fastlane
|
|
32
39
|
|
33
40
|
unless matched.nil?
|
34
41
|
type = matched[1]
|
35
|
-
scope = matched[
|
42
|
+
scope = matched[2]
|
36
43
|
|
37
44
|
result[:is_valid] = true
|
38
45
|
result[:type] = type
|
39
46
|
result[:scope] = scope
|
40
|
-
result[:has_exclamation_mark] = matched[
|
41
|
-
result[:subject] = matched[
|
47
|
+
result[:has_exclamation_mark] = matched[3] == '!'
|
48
|
+
result[:subject] = matched[4]
|
42
49
|
|
43
50
|
unless releases.nil?
|
44
51
|
result[:release] = releases[type.to_sym]
|
@@ -1 +1 @@
|
|
1
|
-
module Fastlane module SemanticRelease VERSION = "1.
|
1
|
+
module Fastlane module SemanticRelease VERSION = "1.12.0" end end
|