Skip to content
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

Remove skip_glotpress and related cleanup #443

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

### Breaking Changes

_None_
- Remove the `skip_glotpress` parameter from the `ios_bump_version_release` action [#443]

### New Features

Original file line number Diff line number Diff line change
@@ -21,10 +21,6 @@ def self.run(params)
Fastlane::Helper::GitHelper.create_branch(@new_release_branch, from: default_branch)
UI.message 'Done!'

UI.message 'Updating glotPressKeys...' unless params[:skip_glotpress]
update_glotpress_key unless params[:skip_glotpress]
UI.message 'Done' unless params[:skip_glotpress]

UI.message 'Updating Fastlane deliver file...' unless params[:skip_deliver]
Fastlane::Helper::Ios::VersionHelper.update_fastlane_deliver(@new_short_version) unless params[:skip_deliver]
UI.message 'Done!' unless params[:skip_deliver]
@@ -35,7 +31,7 @@ def self.run(params)

Fastlane::Helper::Ios::GitHelper.commit_version_bump(
include_deliverfile: !params[:skip_deliver],
include_metadata: !params[:skip_glotpress]
include_metadata: false
)

UI.message 'Done.'
@@ -55,16 +51,11 @@ def self.details

def self.available_options
[
FastlaneCore::ConfigItem.new(key: :skip_glotpress,
env_name: 'FL_IOS_CODEFREEZE_BUMP_SKIPGLOTPRESS',
description: 'Skips GlotPress key update',
is_string: false, # true: verifies the input is a string, false: every kind of value
default_value: false), # the default value if the user didn't provide one
FastlaneCore::ConfigItem.new(key: :skip_deliver,
env_name: 'FL_IOS_CODEFREEZE_BUMP_SKIPDELIVER',
description: 'Skips Deliver key update',
is_string: false, # true: verifies the input is a string, false: every kind of value
default_value: false), # the default value if the user didn't provide one
type: Boolean,
default_value: false),
FastlaneCore::ConfigItem.new(key: :default_branch,
env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
description: 'Default branch of the repository',
@@ -105,15 +96,6 @@ def self.show_config
UI.message("New short version: #{@new_short_version}")
UI.message("Release branch: #{@new_release_branch}")
end

def self.update_glotpress_key
dm_file = ENV['DOWNLOAD_METADATA']
if File.exist?(dm_file)
sh("sed -i '' \"s/let glotPressWhatsNewKey.*/let glotPressWhatsNewKey = \\\"v#{@new_short_version}-whats-new\\\"/\" #{dm_file}")
else
UI.user_error!("Can't find #{dm_file}.")
end
end
end
end
end
46 changes: 46 additions & 0 deletions spec/ios_bump_version_release_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
require 'spec_helper'

describe Fastlane::Actions::IosBumpVersionReleaseAction do
let(:default_branch) { 'my_new_branch' }
let(:versions) { ['6.30'] }
let(:next_version) { '6.31.0.0' }
let(:next_version_short) { '6.31' }

describe 'creates the release branch, bumps the app version and commits the changes' do
before do
other_action_mock = double()
allow(Fastlane::Action).to receive(:other_action).and_return(other_action_mock)
allow(other_action_mock).to receive(:ensure_git_branch).with(branch: default_branch)

allow(Fastlane::Helper::GitHelper).to receive(:checkout_and_pull).with(default_branch)
allow(Fastlane::Helper::GitHelper).to receive(:create_branch).with("release/#{next_version_short}", from: default_branch)

allow(Fastlane::Helper::Ios::VersionHelper).to receive(:get_version_strings).and_return(versions)
allow(Fastlane::Helper::Ios::VersionHelper).to receive(:update_xc_configs).with(next_version, next_version_short, nil)
end

it 'does the fastlane deliver update' do
skip_deliver = false

expect(Fastlane::Helper::Ios::VersionHelper).to receive(:update_fastlane_deliver).with(next_version_short)
expect(Fastlane::Helper::Ios::GitHelper).to receive(:commit_version_bump).with(include_deliverfile: !skip_deliver, include_metadata: false)

run_described_fastlane_action(
skip_deliver: skip_deliver,
default_branch: default_branch
)
end

it 'skips the fastlane deliver update properly' do
skip_deliver = true

expect(Fastlane::Helper::Ios::VersionHelper).not_to receive(:update_fastlane_deliver)
expect(Fastlane::Helper::Ios::GitHelper).to receive(:commit_version_bump).with(include_deliverfile: !skip_deliver, include_metadata: false)

run_described_fastlane_action(
skip_deliver: skip_deliver,
default_branch: default_branch
)
end
end
end