Class: Fastlane::Actions::IosUpdateReleaseNotesAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



54
55
56
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb', line 54

def self.authors
  ['Automattic']
end

.available_optionsObject



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb', line 34

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :new_version,
                                 env_name: 'FL_IOS_UPDATE_RELEASE_NOTES_VERSION',
                                 description: 'The version we are currently freezing; An empty entry for the _next_ version after this one will be added to the release notes',
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :release_notes_file_path,
                                 env_name: 'FL_IOS_UPDATE_RELEASE_NOTES_FILE_PATH',
                                 description: 'The path to the release notes file to be updated',
                                 type: String,
                                 default_value: File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', 'RELEASE-NOTES.txt')),
  ]
end

.descriptionObject



26
27
28
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb', line 26

def self.description
  'Updates the release notes file for the next app version'
end

.detailsObject



30
31
32
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb', line 30

def self.details
  'Updates the release notes file for the next app version'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb', line 58

def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end

.outputObject



48
49
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb', line 48

def self.output
end

.return_valueObject



51
52
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb', line 51

def self.return_value
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb', line 4

def self.run(params)
  UI.message 'Updating the release notes...'

  require_relative '../../helper/ios/ios_version_helper'
  require_relative '../../helper/release_notes_helper'
  require_relative '../../helper/git_helper'

  UI.deprecated('The `PROJECT_ROOT_FOLDER` environment variable is deprecated and will be removed in a future release. Please pass a path to the `release_notes_file_path` param instead.') unless ENV['PROJECT_ROOT_FOLDER'].nil?

  path = params[:release_notes_file_path]
  next_version = Fastlane::Helper::Ios::VersionHelper.calc_next_release_version(params[:new_version])

  Fastlane::Helper::ReleaseNotesHelper.add_new_section(path: path, section_title: next_version)
  Fastlane::Helper::GitHelper.commit(message: "Release Notes: add new section for next version (#{next_version})", files: path)

  UI.message 'Done.'
end