Class: Fastlane::Actions::PublishReleaseAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/auth0_shipper/actions/publish_release_action.rb

Class Method Summary collapse

Class Method Details

.authors ⇒ Object



25
26
27
# File 'lib/fastlane/plugin/auth0_shipper/actions/publish_release_action.rb', line 25

def self.authors
  ["Hernan Zalazar"]
end

.available_options ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/fastlane/plugin/auth0_shipper/actions/publish_release_action.rb', line 37

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :organization,
                            env_name: "AUTH0_SHIPPER_ORGANIZATION",
                         description: "Github organization where the library is available",
                       default_value: "auth0",
                            optional: true,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :repository,
                            env_name: "AUTH0_SHIPPER_REPOSITORY",
                         description: "Github repository name where the library is available",
                            optional: false,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :github_token,
                            env_name: "AUTH0_SHIPPER_GITHUB_TOKEN",
                         description: "Github token to create Pull Request",
                            optional: true,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :changelog,
                            env_name: "AUTH0_SHIPPER_CHANGELOG",
                         description: "Path to the CHANGELOG file",
                       default_value: "CHANGELOG.md",
                            optional: true,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :local_run,
                            env_name: "AUTH0_SHIPPER_LOCAL_RUN",
                         description: "Avoid pushing changes to remote repository",
                       default_value: false,
                            optional: true,
                                type: Boolean),
    FastlaneCore::ConfigItem.new(key: :pod_lint_allow_warnings,
                            env_name: "AUTH0_SHIPPER_POD_LINT_ALLOW_WARNINGS",
                         description: "Avoid allow warnings during pod linter",
                       default_value: false,
                            optional: true,
                                type: Boolean)
  ]
end

.description ⇒ Object



21
22
23
# File 'lib/fastlane/plugin/auth0_shipper/actions/publish_release_action.rb', line 21

def self.description
  "Performs a pending release represented by the latest tag"
end

.details ⇒ Object



33
34
35
# File 'lib/fastlane/plugin/auth0_shipper/actions/publish_release_action.rb', line 33

def self.details
  "Performs the release of an Auth0 OSS library that include pod linter, push to git remote and push to CocoaPods trunk"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/fastlane/plugin/auth0_shipper/actions/publish_release_action.rb', line 76

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

.return_value ⇒ Object



29
30
31
# File 'lib/fastlane/plugin/auth0_shipper/actions/publish_release_action.rb', line 29

def self.return_value

end

.run(params) ⇒ Object



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

def self.run(params)
  tag = Actions::LastGitTagAction.run({})
  UI.header "Publishing release #{tag} 📨"
  changelog_entry = Helper::Auth0ShipperHelper.get_changelog(tag.to_s, params[:changelog])
  Actions::SetGithubReleaseAction.run({
    repository_name: "#{params[:organization]}/#{params[:repository]}",
    api_token: params[:github_token],
    name: tag.to_s,
    tag_name: tag.to_s,
    description: changelog_entry,
    server_url: 'https://api.github.com'
  }) unless params[:github_token].nil?
  Actions::PodLibLintAction.run({allow_warnings: params[:pod_lint_allow_warnings]})
  Actions::PodPushAction.run({allow_warnings: params[:pod_lint_allow_warnings]})
  UI.success "Shipped #{tag}! 🚀"
end