Class: Fastlane::Actions::ReleaseHelperAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::ReleaseHelperAction
- Defined in:
- lib/fastlane/plugin/release_helper/actions/release_helper_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .get_commits_from_hash(params) ⇒ Object
- .get_last_tag(params) ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
48 49 50 |
# File 'lib/fastlane/plugin/release_helper/actions/release_helper_action.rb', line 48 def self. ["Artem Ivanov"] end |
.available_options ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/fastlane/plugin/release_helper/actions/release_helper_action.rb', line 61 def self. [ FastlaneCore::ConfigItem.new( key: :match, description: "Match parameter of git describe. See man page of git describe for more info", verify_block: proc do |value| UI.user_error!("No match for analyze_commits action given, pass using `match: 'expr'`") unless value && !value.empty? end ), FastlaneCore::ConfigItem.new( key: :releases, description: "Map types of commit to release (major, minor, patch)", default_value: { fix: "patch", feat: "minor" }, type: Hash ), FastlaneCore::ConfigItem.new( key: :tag_version_match, description: "To parse version number from tag name", default_value: '\d+\.\d+\.\d+' ) ] end |
.description ⇒ Object
44 45 46 |
# File 'lib/fastlane/plugin/release_helper/actions/release_helper_action.rb', line 44 def self.description "release heper" end |
.details ⇒ Object
56 57 58 59 |
# File 'lib/fastlane/plugin/release_helper/actions/release_helper_action.rb', line 56 def self.details # Optional: "Release helper" end |
.get_commits_from_hash(params) ⇒ Object
12 13 14 15 |
# File 'lib/fastlane/plugin/release_helper/actions/release_helper_action.rb', line 12 def self.get_commits_from_hash(params) commits = Helper::ReleaseHelperHelper.git_log('%s|%b', params[:hash]) commits.split("\n") end |
.get_last_tag(params) ⇒ Object
7 8 9 10 |
# File 'lib/fastlane/plugin/release_helper/actions/release_helper_action.rb', line 7 def self.get_last_tag(params) command = "git describe --tags --match=#{params[:match]}" Actions.sh(command, log: false) end |
.is_supported?(platform) ⇒ Boolean
84 85 86 87 88 89 90 |
# File 'lib/fastlane/plugin/release_helper/actions/release_helper_action.rb', line 84 def self.is_supported?(platform) # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example) # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform # # [:ios, :mac, :android].include?(platform) true end |
.return_value ⇒ Object
52 53 54 |
# File 'lib/fastlane/plugin/release_helper/actions/release_helper_action.rb', line 52 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fastlane/plugin/release_helper/actions/release_helper_action.rb', line 17 def self.run(params) UI.("Inside plugin123") hash = "HEAD" version = "0.0.0" tag = get_last_tag(match: params[:match]) if tag.empty? UI.("First commit of the branch is taken as a begining of next release") # If there is no tag found we taking the first commit of current branch hash = Actions.sh('git rev-list --max-parents=0 HEAD', log: false).chomp else # Tag's format is v2.3.4-5-g7685948 # See git describe man page for more info tag_name = tag.split('-')[0].strip parsed_version = tag_name.match(params[:tag_version_match]) if parsed_version.nil? UI.user_error("Error while parsing version from tag") end version = parsed_version[0] commits = get_commits_from_hash(hash: version) UI.(version) end end |