Class: Fastlane::Actions::SentryFinalizeReleaseAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



66
67
68
# File 'lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb', line 66

def self.authors
  ["wschurman"]
end

.available_optionsObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb', line 40

def self.available_options
  Helper::SentryConfig.common_api_config_items + [
    FastlaneCore::ConfigItem.new(key: :version,
                                 description: "Release version to finalize on Sentry"),
    FastlaneCore::ConfigItem.new(key: :app_identifier,
                                 short_option: "-a",
                                 env_name: "SENTRY_APP_IDENTIFIER",
                                 description: "App Bundle Identifier, prepended to version",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :build,
                                 short_option: "-b",
                                 description: "Release build to finalize on Sentry",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :release_url,
                                 description: "Optional URL to the release for information purposes",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :released,
                                 description: "Set the release time. Defaults to the current time if not provided",
                                 optional: true)
  ]
end

.descriptionObject



29
30
31
# File 'lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb', line 29

def self.description
  "Finalize a release for a project on Sentry"
end

.detailsObject



33
34
35
36
37
38
# File 'lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb', line 33

def self.details
  [
    "This action allows you to finalize releases created for a project on Sentry.",
    "See https://docs.sentry.io/learn/cli/releases/#finalizing-releases for more information."
  ].join(" ")
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb', line 70

def self.is_supported?(platform)
  true
end

.return_valueObject



62
63
64
# File 'lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb', line 62

def self.return_value
  nil
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fastlane/plugin/sentry/actions/sentry_finalize_release.rb', line 4

def self.run(params)
  require 'shellwords'

  Helper::SentryConfig.parse_api_params(params)

  version = params[:version]
  version = "#{params[:app_identifier]}@#{params[:version]}" if params[:app_identifier]
  version = "#{version}+#{params[:build]}" if params[:build]

  command = [
    "releases",
    "finalize",
    version
  ]
  command.push("--url").push(params[:release_url]) unless params[:release_url].nil?
  command.push("--released").push(params[:released]) unless params[:released].nil?

  Helper::SentryHelper.call_sentry_cli(params, command)
  UI.success("Successfully finalized release: #{version}")
end