diff --git a/CHANGELOG.md b/CHANGELOG.md index 801db7d21..058c75323 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_github_release_action.rb similarity index 93% rename from lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb rename to lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_github_release_action.rb index f294a362b..5672ea5ec 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_github_release_action.rb @@ -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 + def self.category + :deprecated + end + + def self.deprecated_notes + "This action has been renamed `#{superclass.action_name}`" + end + end end end diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/publish_release_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/publish_github_release_action.rb similarity index 97% rename from lib/fastlane/plugin/wpmreleasetoolkit/actions/common/publish_release_action.rb rename to lib/fastlane/plugin/wpmreleasetoolkit/actions/common/publish_github_release_action.rb index ef472a245..144f06b40 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/publish_release_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/publish_github_release_action.rb @@ -3,7 +3,7 @@ module Fastlane module Actions - class PublishReleaseAction < Action + class PublishGithubReleaseAction < Action def self.run(params) repository = params[:repository] name = params[:name] diff --git a/spec/publish_release_spec.rb b/spec/publish_github_release_spec.rb similarity index 91% rename from spec/publish_release_spec.rb rename to spec/publish_github_release_spec.rb index 174fe6f92..5cedddd13 100644 --- a/spec/publish_release_spec.rb +++ b/spec/publish_github_release_spec.rb @@ -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' } @@ -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 @@ -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