fastlane-plugin-write_changelog_from_commits 0.1.0 → 1.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 611dd8a25518c6b4f3dc41d3e04283d31be81160d5a947b75c36e6c334eb08de
|
4
|
+
data.tar.gz: bc68014ed00794e028b9d03f2459816397c26642c187461932f6e65495ff4683
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d45038790cfead4ee75949da6667beabd4b4dfa6acb413978ab2799f521d1b784f1486690b55cf28eda454033da1b9a61f472353a87b2cc52b4099dbb04107e
|
7
|
+
data.tar.gz: 0d5378f8073266c983bd3d920894c853548506fd5d713209e965c61534545fa9dd55b34ad04942298eb612173fbca435566e26bd808500f88b6b0e4732139dd0
|
data/lib/fastlane/plugin/write_changelog_from_commits/actions/write_changelog_from_commits_action.rb
CHANGED
@@ -4,9 +4,12 @@ require_relative '../helper/write_changelog_from_commits_helper'
|
|
4
4
|
module Fastlane
|
5
5
|
module Actions
|
6
6
|
class WriteChangelogFromCommitsAction < Action
|
7
|
-
OTHER_SECTION = "Other"
|
8
7
|
|
9
8
|
def self.run(params)
|
9
|
+
if params[:additional_section_name].nil? && params[:commit_prefixes].nil?
|
10
|
+
raise "Please provide either 'additional_section_name' or 'commit_prefixes' to action"
|
11
|
+
end
|
12
|
+
|
10
13
|
from = Actions.last_git_tag_name
|
11
14
|
UI.verbose("Found the last Git tag: #{from}")
|
12
15
|
to = 'HEAD'
|
@@ -23,7 +26,7 @@ module Fastlane
|
|
23
26
|
changelog = changelog.gsub("\n\n", "\n") if changelog # as there are duplicate newlines
|
24
27
|
raise "No logs found since last tag" if changelog.strip.empty?
|
25
28
|
|
26
|
-
raw_release_notes = create_raw_release_notes(changelog, params[:commit_prefixes])
|
29
|
+
raw_release_notes = create_raw_release_notes(changelog, params[:commit_prefixes], params[:additional_section_name])
|
27
30
|
|
28
31
|
release_notes = create_release_notes(raw_release_notes)
|
29
32
|
Actions.lane_context[SharedValues::FL_CHANGELOG] = release_notes
|
@@ -40,19 +43,21 @@ module Fastlane
|
|
40
43
|
end
|
41
44
|
end
|
42
45
|
|
43
|
-
def self.create_raw_release_notes(changelog, commit_prefixes)
|
46
|
+
def self.create_raw_release_notes(changelog, commit_prefixes, additional_section_name)
|
44
47
|
raw_release_notes = commit_prefixes.to_h { |p| [p.capitalize, []] }
|
45
|
-
raw_release_notes[
|
48
|
+
raw_release_notes[additional_section_name.capitalize] = [] if additional_section_name
|
46
49
|
changelog.each_line do |line|
|
47
50
|
section_exists = false
|
48
51
|
commit_prefixes.each do |prefix|
|
49
52
|
next unless line.downcase.start_with?(prefix.downcase)
|
50
53
|
|
51
|
-
raw_release_notes[prefix.capitalize] << line.slice(prefix.length..line.length).strip
|
54
|
+
raw_release_notes[prefix.capitalize] << line.slice(prefix.length..line.length).strip.capitalize
|
52
55
|
section_exists = true
|
53
56
|
break
|
54
57
|
end
|
55
|
-
|
58
|
+
if additional_section_name && !section_exists
|
59
|
+
raw_release_notes[additional_section_name.capitalize] << line.strip.capitalize
|
60
|
+
end
|
56
61
|
end
|
57
62
|
raw_release_notes
|
58
63
|
end
|
@@ -95,14 +100,14 @@ module Fastlane
|
|
95
100
|
[
|
96
101
|
FastlaneCore::ConfigItem.new(
|
97
102
|
key: :path,
|
98
|
-
env_name: '
|
103
|
+
env_name: 'WRITE_CHANGELOG_FROM_COMMITS_PATH',
|
99
104
|
description: 'Path of the git repository',
|
100
105
|
optional: true,
|
101
106
|
default_value: './'
|
102
107
|
),
|
103
108
|
FastlaneCore::ConfigItem.new(
|
104
109
|
key: :quiet,
|
105
|
-
env_name: '
|
110
|
+
env_name: 'WRITE_CHANGELOG_FROM_COMMITS_TAG_QUIET',
|
106
111
|
description: 'Whether or not to disable changelog output',
|
107
112
|
optional: true,
|
108
113
|
default_value: false,
|
@@ -110,20 +115,26 @@ module Fastlane
|
|
110
115
|
),
|
111
116
|
FastlaneCore::ConfigItem.new(
|
112
117
|
key: :changelog_dir,
|
113
|
-
env_name: '
|
118
|
+
env_name: 'WRITE_CHANGELOG_FROM_COMMITS_CHANGELOG_DIR',
|
114
119
|
description: 'Path to write new changelogs',
|
115
120
|
optional: false
|
116
121
|
),
|
117
122
|
FastlaneCore::ConfigItem.new(
|
118
123
|
key: :commit_prefixes,
|
119
|
-
env_name: "
|
120
|
-
description: "List of prefixes to group in the changelog",
|
124
|
+
env_name: "WRITE_CHANGELOG_FROM_COMMITS_PREFIXES",
|
125
|
+
description: "List of prefixes to group in the changelog (omit to place all lines under additional_section_name)",
|
121
126
|
type: Array,
|
122
127
|
optional: true
|
123
128
|
),
|
129
|
+
FastlaneCore::ConfigItem.new(
|
130
|
+
key: :additional_section_name,
|
131
|
+
env_name: "WRITE_CHANGELOG_FROM_COMMITS_ADDITIONAL_SECTION",
|
132
|
+
description: "Section to contain all other commit lines (omit if you only want to log lines beginning with prefixes)",
|
133
|
+
optional: true
|
134
|
+
),
|
124
135
|
FastlaneCore::ConfigItem.new(
|
125
136
|
key: :version_code,
|
126
|
-
env_name: "
|
137
|
+
env_name: "WRITE_CHANGELOG_FROM_COMMITS_VERSION_CODE",
|
127
138
|
description: "Version code used to create file",
|
128
139
|
optional: true
|
129
140
|
)
|