Skip to content

Commit

Permalink
Rename publish_release and create_release to `publish_github_rele…
Browse files Browse the repository at this point in the history
…ase` and `create_github_release`
  • Loading branch information
iangmaia committed Sep 2, 2024
1 parent d9c348e commit eb321aa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

### New Features

- Added the `publish_release` action to publish existing GitHub draft releases [#585]
- Added the `publish_github_release` action to publish existing GitHub draft releases [#585]

### Bug Fixes

_None_
- Deprecated the `create_release` action, now renamed to `create_github_release` for consistency [#585]

### Internal Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -100,5 +100,16 @@ def self.is_supported?(platform)
true
end
end

# For backwards compatibility
class CreateReleaseAction < CreateGithubReleaseAction
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
Expand Up @@ -3,7 +3,7 @@

module Fastlane
module Actions
class PublishReleaseAction < Action
class PublishGithubReleaseAction < Action
def self.run(params)
repository = params[:repository]
name = params[:name]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'

describe Fastlane::Actions::PublishReleaseAction do
describe Fastlane::Actions::PublishGithubReleaseAction do
let(:test_token) { 'ghp_fake_token' }
let(:test_repo) { 'repo-test/project-test' }
let(:test_name) { '1.0.0' }
Expand All @@ -12,7 +12,7 @@

context 'when providing valid parameters' do
it 'publishes the release and returns the URL' do
expect(github_helper).to receive(:publish_release).with(
allow(github_helper).to receive(:publish_release).with(
repository: test_repo,
name: test_name,
prerelease: false
Expand All @@ -28,7 +28,7 @@
end

it 'publishes a prerelease when specified' do
expect(github_helper).to receive(:publish_release).with(
allow(github_helper).to receive(:publish_release).with(
repository: test_repo,
name: test_name,
prerelease: true
Expand Down

0 comments on commit eb321aa

Please sign in to comment.