Skip to content

Commit

Permalink
remove unsupported languages from the settings bundle for RC build
Browse files Browse the repository at this point in the history
  • Loading branch information
kambala-decapitator committed Mar 19, 2022
1 parent 8ba55bc commit 959e968
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'https://rubygems.org'

gem 'fastlane'
gem 'xcodeproj'
gem 'xcode-install'
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ PLATFORMS
DEPENDENCIES
fastlane
xcode-install
xcodeproj

BUNDLED WITH
2.3.9
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,15 @@ To be able to also create prerelease+tag on Github, define `GITHUB_API_TOKEN` en

`GITHUB_API_TOKEN=your_PAT_token bundle exec fastlane tf notify:0`

### Submit to AppStore review
### Submit for AppStore review

`bundle exec fastlane asc`
First, make an RC build with unfinished localizations excluded from the settings bundle: (it supports the same parameters as the normal `tf` lane described above)

bundle exec fastlane rc

In case there're no changes compared to the last TF build, don't define `GITHUB_API_TOKEN` environment variable to prevent useless Github release being created.

Submit for review: `bundle exec fastlane asc`

If you also want to draft release on Github, define `GITHUB_API_TOKEN` environment variable like above.

Expand All @@ -62,7 +68,7 @@ Optional parameters:

Omitted `app_version` / `build_number` parameter means "use the latest uploaded". [More about passing parameters](https://docs.fastlane.tools/advanced/lanes/#passing-parameters).

Note: if new app version doesn't exist yet, you **must** pass at least `app_version`, otherwise fastlane fails. Hopefully it'll be fixed, see [issue about that](https://github.com/fastlane/fastlane/issues/18571).
Note: if new app version doesn't exist in ASC yet, you **must** pass at least `app_version`, otherwise fastlane fails. Hopefully it'll be fixed, see [issue about that](https://github.com/fastlane/fastlane/issues/18571).

Example: `bundle exec fastlane asc app_version:1.6.1`

Expand Down
29 changes: 29 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
fastlane_require 'xcodeproj'

default_platform(:ios)

before_all do
Expand Down Expand Up @@ -45,6 +47,7 @@ lane :tf do |options|
changelogLines << "- #{l.sub(/\(Merge pull request (#\d+).+/, "(\\1)")}" unless l.include?('[not app]')
}
Actions.lane_context[SharedValues::FL_CHANGELOG] = changelogLines.join("\n")
Actions.lane_context[SharedValues::FL_CHANGELOG].prepend "#{options[:changelogTitle]}\n\n" if options[:changelogTitle]

testflight(
distribute_external: true,
Expand Down Expand Up @@ -91,6 +94,32 @@ lane :tf do |options|
}
end

desc 'Build RC & upload to Testflight'
lane :rc do |options|
# remove unsupported languages from the settings bundle
localizationDirExtension = '.lproj'
xcProject = Xcodeproj::Project.open('../Kodi Remote.xcodeproj')
localizations = xcProject.files
.filter {|f| f.path.end_with? 'Localizable.strings' }
.map {|f| f.name.downcase }
settingsBundlePath = xcProject.files.find {|f| f.path.end_with? 'Settings.bundle' }.real_path
Dir.each_child(settingsBundlePath) { |f|
next unless File.extname(f) == localizationDirExtension
FileUtils.remove_dir "#{settingsBundlePath}/#{f}" unless localizations.include? File.basename(f, localizationDirExtension).downcase
}

begin
tf options.merge({
changelogTitle: 'This RC will be submitted for AppStore review.',
})
ensure
reset_git_repo(
files: [settingsBundlePath],
force: true,
)
end
end

desc 'Submit to AppStore review'
lane :asc do |options|
appVersion = options[:app_version]
Expand Down

0 comments on commit 959e968

Please sign in to comment.