fastlane-plugin-changelog 0.5.1 → 0.6.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: e066c1d6080f5b420db6486b92b99b139fd7e558
4
- data.tar.gz: 61d471439bd314f56e3a70653841c6b6cf8852d8
3
+ metadata.gz: 2e2a3068eec0233c38bcec3e8c1f0cc9487dec34
4
+ data.tar.gz: 94e86e6da58136da6ab607f14354029d9836fbc8
5
5
  SHA512:
6
- metadata.gz: 0746da8916f3ed5d274701c8cfeb873ba0a34a63809d45b43bdeca5fc83b2bfa11e3dbfbf6d4d45ac8a759b3f2dce25d5d238fecf12ed7a075078d5e364ed354
7
- data.tar.gz: 995ac63588bb1a574a773c85cea2b2055ef2bcea504af6ed5e3ae1c44ebb178723902481c1bbffcdf55c4ef3d9c1be37769219daf62271b356b0203c9d2dcf7c
6
+ metadata.gz: 3e1617f7c34fdce1e1cdcb8956df0fedffbccb828da1c5ca8f2ad49f9988e13b03fec5d43a1c271b788f7cb3f11a0ce81f17e34b85bec43bf0cf37879a1368bf
7
+ data.tar.gz: 6638d73d36df78ec25a1dae2f78c154f64e88c0bfa42c552227d6314d5d9404e8c75afc9534513bf708a32f2168f4b8fa7faa5b5dfa7119bb86faef9b78d5dfb
data/README.md CHANGED
@@ -56,6 +56,69 @@ stamp_changelog(
56
56
  )
57
57
  ```
58
58
 
59
+ ### 😁 emojify_changelog
60
+ Emojifies the output of `read_changelog` action. When you share changelog with the rest of your team on e.g.: Slack channel, it's nice to sprinkle your subsections with a bit of visuals so it immediately catches eyes of your teammates. `emojify_changelog` uses the output of `read_changelog` action to append an emoji to known subsections, for example:
61
+
62
+ ```
63
+ Added:
64
+ - New awesome feature
65
+
66
+ Changed:
67
+ - Onboarding flow
68
+
69
+ Fixed:
70
+ - Fix Markdown links
71
+
72
+ Removed:
73
+ - User tracking
74
+
75
+ Work In Progress:
76
+ - Sales screen
77
+
78
+ Security:
79
+ - Enable SSL pinning
80
+
81
+ Deprecated:
82
+ - Obsolete contact screen
83
+ ```
84
+
85
+ into
86
+
87
+
88
+ ```
89
+ Added 🎁:
90
+ - New awesome feature
91
+
92
+ Changed ↔️:
93
+ - Onboarding flow UI
94
+
95
+ Fixed ✅:
96
+ - Fix Markdown links
97
+
98
+ Removed 🚫:
99
+ - User tracking
100
+
101
+ Work In Progress 🚧:
102
+ - Sales screen
103
+
104
+ Security 🔒:
105
+ - Enable SSL pinning
106
+
107
+ Deprecated 💨:
108
+ - Obsolete contact screen
109
+ ```
110
+
111
+ Example of use:
112
+ ``` ruby
113
+ changelog = read_changelog # Read changelog
114
+ pilot(changelog: changelog) # Send binary and changelog to TestFlight
115
+ emojified_changelog = emojify_changelog
116
+ slack(message: "Hey team, we have a new build for you, which includes the following: #{emojified_changelog}")
117
+
118
+ ```
119
+
120
+ *NOTE*: do not send emojified changelog to iTunes Connect as it cannot handle emojies.
121
+
59
122
  ## Example
60
123
  As a developer you have to **remember to keep your CHANGELOG.md up-to-date** with whatever features, bug fixes etc. your repo contains and let [`fastlane`](https://fastlane.tools) do the rest.
61
124
 
@@ -0,0 +1,86 @@
1
+ module Fastlane
2
+ module Actions
3
+ module SharedValues
4
+ EMOJIFY_CHANGELOG_CONTENT = :EMOJIFY_CHANGELOG_CONTENT
5
+ end
6
+
7
+ class EmojifyChangelogAction < Action
8
+ SUBSECTION_IDENTIFIERS = ['Added', 'Changed', 'Fixed', 'Removed', 'Work In Progress', 'Security', 'Deprecated']
9
+
10
+ def self.run(params)
11
+ UI.message "Emojifying the output of read_changelog action"
12
+
13
+ read_changelog_output = lane_context[SharedValues::READ_CHANGELOG_SECTION_CONTENT]
14
+ changelog_path = lane_context[SharedValues::READ_CHANGELOG_CHANGELOG_PATH]
15
+
16
+ line_separator = Helper::ChangelogHelper.get_line_separator(changelog_path)
17
+ emojified_content = ""
18
+
19
+ # Read through read changelog output string
20
+ read_changelog_output.each_line do |line|
21
+ # Remove leading or trailing whitespaces
22
+ stripped = line.strip
23
+ # Remove trailing colon (if any)
24
+ if stripped.end_with?(':')
25
+ stripped.chop!
26
+ chopped_colon = true
27
+ end
28
+
29
+ if SUBSECTION_IDENTIFIERS.include?(stripped)
30
+ emojified_string = case stripped
31
+ when 'Added' then 'Added 🎁'
32
+ when 'Changed' then 'Changed ↔️'
33
+ when 'Fixed' then 'Fixed ✅'
34
+ when 'Removed' then 'Removed 🚫'
35
+ when 'Work In Progress' then 'Work In Progress 🚧'
36
+ when 'Security' then 'Security 🔒'
37
+ when 'Deprecated' then 'Deprecated 💨'
38
+ end
39
+
40
+ # Add back trailing colon, if previously removed
41
+ if chopped_colon
42
+ emojified_string.concat(':')
43
+ end
44
+
45
+ # Add line break to the end of the string, in order to start next line on the next line
46
+ emojified_string.concat(line_separator)
47
+
48
+ # Output updated line
49
+ emojified_content.concat(emojified_string)
50
+ else
51
+ # Output updated line
52
+ emojified_content.concat(line)
53
+ end
54
+ end
55
+
56
+ UI.success("Successfuly emojified output of read_changelog action")
57
+
58
+ Actions.lane_context[SharedValues::EMOJIFY_CHANGELOG_CONTENT] = emojified_content
59
+ end
60
+
61
+ #####################################################
62
+ # @!group Documentation
63
+ #####################################################
64
+
65
+ def self.description
66
+ "Emojifies the output of read_changelog action"
67
+ end
68
+
69
+ def self.details
70
+ "This action uses the output of read_changelog action to append an emoji to known subsections"
71
+ end
72
+
73
+ def self.available_options
74
+ []
75
+ end
76
+
77
+ def self.authors
78
+ ["pajapro"]
79
+ end
80
+
81
+ def self.is_supported?(platform)
82
+ true
83
+ end
84
+ end
85
+ end
86
+ end
@@ -2,6 +2,7 @@ module Fastlane
2
2
  module Actions
3
3
  module SharedValues
4
4
  READ_CHANGELOG_SECTION_CONTENT = :READ_CHANGELOG_SECTION_CONTENT
5
+ READ_CHANGELOG_CHANGELOG_PATH = :READ_CHANGELOG_CHANGELOG_PATH
5
6
  end
6
7
 
7
8
  class ReadChangelogAction < Action
@@ -40,6 +41,7 @@ module Fastlane
40
41
 
41
42
  UI.success("Finished reading #{section_identifier} section from '#{changelog_path}'") unless section_content.empty?
42
43
 
44
+ Actions.lane_context[SharedValues::READ_CHANGELOG_CHANGELOG_PATH] = changelog_path
43
45
  Actions.lane_context[SharedValues::READ_CHANGELOG_SECTION_CONTENT] = section_content
44
46
  end
45
47
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Changelog
3
- VERSION = "0.5.1"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Prochazka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-12 00:00:00.000000000 Z
11
+ date: 2016-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -100,6 +100,7 @@ executables: []
100
100
  extensions: []
101
101
  extra_rdoc_files: []
102
102
  files:
103
+ - lib/fastlane/plugin/changelog/actions/emojify_changelog.rb
103
104
  - lib/fastlane/plugin/changelog/actions/read_changelog.rb
104
105
  - lib/fastlane/plugin/changelog/actions/stamp_changelog.rb
105
106
  - lib/fastlane/plugin/changelog/actions/update_changelog.rb