From ee73f42a98dd0898a1fbd76ccfa60b3791ca0ba6 Mon Sep 17 00:00:00 2001 From: "i.o.novikov" Date: Thu, 31 Mar 2022 01:35:30 +0300 Subject: [PATCH] extended bump version file option --- README.md | 12 ++---------- fastlane/Fastfile | 8 +++++++- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d1ff212..e21ae9f 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ source "https://rubygems.org" gem "cocoapods", "~> 1.11.3" gem 'fastlane', '~> 2.204.3' +gem 'fastlane-plugin-changelog' gem 'rubocop', '~> 0.93.1' # if exists gem 'rubocop-require_tools' @@ -94,18 +95,11 @@ plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') eval_gemfile(plugins_path) if File.exist?(plugins_path) ``` -2. `fastlane/Pluginfile` - -``` -gem 'fastlane-plugin-changelog' -``` - -3. `fastlane/Fastfile` +2`fastlane/Fastfile` ```ruby import_from_git( url: "https://github.com/tinkoff-mobile-tech/workflows.git", - branch: "master", path: "fastlane/Fastfile" ) ``` @@ -126,7 +120,6 @@ jobs: with: xcodeproj_path: "TinkoffID.xcodeproj" scheme_name: "TinkoffID-Package" - podspec_name: "TinkoffID.podspec" ``` it calls `lint_fastfile`, `pod_lib_lint`, `swift package generate-xcodeproj`, `xcodebuild clean build`. @@ -150,7 +143,6 @@ jobs: with: xcodeproj_path: "TinkoffID.xcodeproj" scheme_name: "TinkoffID-Package" - podspec_name: "TinkoffID.podspec" bump_type: ${{ inputs.bump_type }} secrets: cocapods_trunk_token: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 04eb36c..a59b612 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -11,6 +11,8 @@ lane :release do |options| version = version_bump_podspec(path: podspec_name, bump_type: bump_type) end + add_files = extend_bump_version(version: version) + text = read_changelog changelog = File.open('new_changes.txt', "w") changelog.puts(text) @@ -24,7 +26,7 @@ lane :release do |options| stamp_changelog(section_identifier: version) # Creating release commit and tag - git_commit(path: ["CHANGELOG.md"] + podspec_names, message: "Release #{version}") + git_commit(path: ["CHANGELOG.md"] + podspec_names + add_files, message: "Release #{version}", skip_git_hooks: true) add_git_tag(tag: version) # Pushing to remote repo @@ -36,6 +38,10 @@ lane :release do |options| end end +lane :extend_bump_version do |options| + [] +end + lane :check do # Linting ruby files lint_fastfile