diff --git a/.github/workflows/ipad-build.yaml b/.github/workflows/ipad-build.yaml index 71a05a7d8..6f5c80498 100644 --- a/.github/workflows/ipad-build.yaml +++ b/.github/workflows/ipad-build.yaml @@ -120,3 +120,21 @@ jobs: with: name: gum-logs path: /Users/runner/Library/Logs/gym/*.log + + - name: Summary + run: | + echo '### Successful iPad build 🚀🚀🚀' >> $GITHUB_STEP_SUMMARY + echo 'Well done!' >> $GITHUB_STEP_SUMMARY + echo 'The app with build version: ${{ env.VERSION_CODE }}(${{ env.BUILD_CODE }})' >> $GITHUB_STEP_SUMMARY + echo 'Uploaded to TestFlight' >> $GITHUB_STEP_SUMMARY + + - name: Comment PR + uses: thollander/actions-comment-pull-request@v3 + if: github.event_name == 'pull_request' + with: + message: | + ### Successful iPad build 🚀🚀🚀 + Well done! + The app with build version: ${{ env.VERSION_CODE }}(${{ env.BUILD_CODE }}) + Uploaded to TestFlight + comment-tag: ipad_build diff --git a/apps/tablet/Gemfile b/apps/tablet/Gemfile index 8bdd597b6..1f39b80e2 100644 --- a/apps/tablet/Gemfile +++ b/apps/tablet/Gemfile @@ -2,4 +2,6 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 3.3.0" gem 'cocoapods', '~> 1.13' -gem "fastlane" \ No newline at end of file +gem "fastlane" +plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') +eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/apps/tablet/Gemfile.lock b/apps/tablet/Gemfile.lock index 6e4f40774..c73c45a14 100644 --- a/apps/tablet/Gemfile.lock +++ b/apps/tablet/Gemfile.lock @@ -170,6 +170,7 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) + fastlane-plugin-json (1.1.7) fastlane-sirp (1.0.0) sysrandom (~> 1.0) ffi (1.17.0) @@ -313,6 +314,7 @@ PLATFORMS DEPENDENCIES cocoapods (~> 1.13) fastlane + fastlane-plugin-json RUBY VERSION ruby 3.3.6p108 diff --git a/apps/tablet/fastlane/Appfile b/apps/tablet/fastlane/Appfile new file mode 100644 index 000000000..d03e535b7 --- /dev/null +++ b/apps/tablet/fastlane/Appfile @@ -0,0 +1,2 @@ +app_identifier(ENV["BUNDLE_IDENTIFIER"]) +team_id(ENV["APP_STORE_CONNECT_TEAM_ID"]) \ No newline at end of file diff --git a/apps/tablet/fastlane/Fastfile b/apps/tablet/fastlane/Fastfile index b72d65efb..366cbe80d 100644 --- a/apps/tablet/fastlane/Fastfile +++ b/apps/tablet/fastlane/Fastfile @@ -1,14 +1,18 @@ + platform :ios do + xcodeproj = "./ios/App/App.xcodeproj" + workspace = "./ios/App/App.xcworkspace" + desc 'Export ipa and submit to TestFlight' lane :beta do keychain_info = { keychain_name: "ios-build-#{Time.now.to_i}.keychain", keychain_password: SecureRandom.uuid } - + + begin setup_signing(keychain_info) load_asc_api_key bump_build_number build_app_with_signing(keychain_info) - create_changelog submit_to_testflight ensure cleanup_keychain(keychain_info) @@ -41,26 +45,34 @@ platform :ios do end lane :bump_build_number do + package = read_json(json_path: "./package.json") + increment_version_number( + xcodeproj: xcodeproj, + version_number: package[:version] + ) + api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] + app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) - xcodeproj = "./ios/App/App.xcodeproj"; current_version = get_version_number(xcodeproj: xcodeproj) latest_build_number = app_store_build_number( - initial_build_number: 5, + initial_build_number: 0, api_key: api_key, - app_identifier: ENV['BUNDLE_IDENTIFIER'], + app_identifier: app_identifier, + version: package[:version], live: false ) build_number = latest_build_number + 1 - + increment_build_number( xcodeproj: xcodeproj, build_number: build_number ) UI.message("Bumped build number to #{build_number}") - sh("echo VERSION_CODE=#{build_number} >> $GITHUB_ENV") + sh("echo VERSION_CODE=#{package["version"]} >> $GITHUB_ENV") + sh("echo BUILD_CODE=#{build_number} >> $GITHUB_ENV") end private_lane :import_cert do |options| @@ -92,18 +104,21 @@ platform :ios do end private_lane :update_project_settings do + app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) + team_id = CredentialsManager::AppfileConfig.try_fetch_value(:team_id) + update_code_signing_settings( - path: "./ios/App/App.xcodeproj", + path: xcodeproj, use_automatic_signing: false, code_sign_identity: "iPhone Distribution", - team_id: ENV['APP_STORE_CONNECT_TEAM_ID'], - bundle_identifier: ENV['BUNDLE_IDENTIFIER'], + team_id: team_id, + bundle_identifier: app_identifier, profile_name: ENV['APPLE_PROFILE_NAME'], ) update_project_team( - path: "./ios/App/App.xcodeproj", - teamid: ENV['APP_STORE_CONNECT_TEAM_ID'] + path: xcodeproj, + teamid: team_id ) end @@ -113,15 +128,16 @@ platform :ios do password: options[:keychain_password], set_default: false ) + app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier) build_app( - workspace: "./ios/App/App.xcworkspace", + workspace: workspace, scheme: "App", configuration: "Release", export_method: "app-store", - output_name: "App.ipa", + output_name: "TonkeeperPro.ipa", export_options: { provisioningProfiles: { - ENV['BUNDLE_IDENTIFIER'] => ENV['APPLE_PROFILE_NAME'] + app_identifier => ENV['APPLE_PROFILE_NAME'] } }, xcargs: "-verbose", @@ -133,7 +149,10 @@ platform :ios do private_lane :submit_to_testflight do api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] ipa = lane_context[SharedValues::IPA_OUTPUT_PATH] - changelog = changelog_from_git_commits(commits_count: 10, merge_commit_filtering: "exclude_merges") + changelog = changelog_from_git_commits( + merge_commit_filtering: "exclude_merges", + between: ["origin/main", "HEAD"] + ) pilot( api_key: api_key, diff --git a/apps/tablet/fastlane/Pluginfile b/apps/tablet/fastlane/Pluginfile new file mode 100644 index 000000000..bffd8eb24 --- /dev/null +++ b/apps/tablet/fastlane/Pluginfile @@ -0,0 +1,5 @@ +# Autogenerated by fastlane +# +# Ensure this file is checked in to source control! + +gem 'fastlane-plugin-json' diff --git a/apps/tablet/fastlane/README.md b/apps/tablet/fastlane/README.md new file mode 100644 index 000000000..233c5febd --- /dev/null +++ b/apps/tablet/fastlane/README.md @@ -0,0 +1,40 @@ +fastlane documentation +---- + +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +```sh +xcode-select --install +``` + +For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) + +# Available Actions + +## iOS + +### ios beta + +```sh +[bundle exec] fastlane ios beta +``` + +Export ipa and submit to TestFlight + +### ios bump_build_number + +```sh +[bundle exec] fastlane ios bump_build_number +``` + + + +---- + +This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. + +More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). + +The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).