Skip to content

Commit

Permalink
UI.message("Changelog: #{changelog}")
Browse files Browse the repository at this point in the history
Add Comments

Remove line

App file + fix change log

Update variable

profile_name

Revert "profile_name"

This reverts commit 245295d.

Update change log

Add version number

master => main

Add json plugin

Update package path
  • Loading branch information
KuznetsovNikita committed Dec 8, 2024
1 parent 49adf1d commit 54d05fe
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 17 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ipad-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion apps/tablet/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
gem "fastlane"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
2 changes: 2 additions & 0 deletions apps/tablet/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -313,6 +314,7 @@ PLATFORMS
DEPENDENCIES
cocoapods (~> 1.13)
fastlane
fastlane-plugin-json

RUBY VERSION
ruby 3.3.6p108
Expand Down
2 changes: 2 additions & 0 deletions apps/tablet/fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
app_identifier(ENV["BUNDLE_IDENTIFIER"])
team_id(ENV["APP_STORE_CONNECT_TEAM_ID"])
51 changes: 35 additions & 16 deletions apps/tablet/fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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|
Expand Down Expand Up @@ -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

Expand All @@ -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",
Expand All @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions apps/tablet/fastlane/Pluginfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-json'
40 changes: 40 additions & 0 deletions apps/tablet/fastlane/README.md
Original file line number Diff line number Diff line change
@@ -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).

0 comments on commit 54d05fe

Please sign in to comment.