-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish Release Action #585
Changes from all commits
fd7fbcb
05d2481
5f5284b
27a9f8d
ebbd05b
d9c348e
eb321aa
f9fa87c
18e63b1
8755825
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
require_relative '../../helper/android/android_version_helper' | ||
module Fastlane | ||
module Actions | ||
class CreateReleaseAction < Action | ||
class CreateGithubReleaseAction < Action | ||
def self.run(params) | ||
repository = params[:repository] | ||
version = params[:version] | ||
|
@@ -100,5 +100,16 @@ def self.is_supported?(platform) | |
true | ||
end | ||
end | ||
|
||
# For backwards compatibility | ||
class CreateReleaseAction < CreateGithubReleaseAction | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if it makes more sense to document this in the I think in the past we went with the latter, but I'm open to debate it if some you think it makes more sense to go with the former 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm yeah I think it makes sense to document it there only when the migration is actually needed, so I'd just mention it in the version where we actually remove it, breaking the compatibility 🤔 I think the changelog update should be enough heads up that this is going to change? |
||
def self.category | ||
:deprecated | ||
end | ||
|
||
def self.deprecated_notes | ||
"This action has been renamed `#{superclass.action_name}`" | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
require 'fastlane/action' | ||
require_relative '../../helper/github_helper' | ||
|
||
module Fastlane | ||
module Actions | ||
class PublishGithubReleaseAction < Action | ||
def self.run(params) | ||
repository = params[:repository] | ||
name = params[:name] | ||
prerelease = params[:prerelease] | ||
|
||
github_helper = Fastlane::Helper::GithubHelper.new(github_token: params[:github_token]) | ||
|
||
url = github_helper.publish_release( | ||
repository: repository, | ||
name: name, | ||
prerelease: prerelease == :unchanged ? nil : prerelease | ||
) | ||
UI.success("Successfully published GitHub Release #{name}. You can see it at '#{url}'") | ||
url | ||
end | ||
|
||
def self.description | ||
'Publish an existing GitHub Release still in draft mode' | ||
end | ||
|
||
def self.authors | ||
['Automattic'] | ||
end | ||
|
||
def self.return_value | ||
'The URL of the published GitHub Release' | ||
end | ||
|
||
def self.details | ||
'Publish an existing GitHub Release still in draft mode' | ||
end | ||
|
||
def self.available_options | ||
[ | ||
FastlaneCore::ConfigItem.new(key: :repository, | ||
description: 'The slug (`<org>/<repo>`) of the GitHub repository we want to create the release on', | ||
optional: false, | ||
type: String), | ||
FastlaneCore::ConfigItem.new(key: :name, | ||
description: 'The name (aka title) of the draft release to publish', | ||
optional: false, | ||
type: String), | ||
FastlaneCore::ConfigItem.new(key: :prerelease, | ||
description: 'True to publish as a pre-release. False to published as final. Don\'t provide a value to keep the same (non-)prerelease status as the one used in the Draft', | ||
optional: true, | ||
default_value: :unchanged, | ||
type: Boolean), | ||
Comment on lines
+52
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Love it how in Ruby we can pass a symbol as default value and then declare the type as Boolean... 😅 |
||
Fastlane::Helper::GithubHelper.github_token_config_item, | ||
] | ||
end | ||
|
||
def self.is_supported?(platform) | ||
true | ||
end | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 🧹