Skip to content

Commit

Permalink
Merge pull request #2471 from get10101/feat/update-fastlane
Browse files Browse the repository at this point in the history
feat: automatically add app for review in testflight
  • Loading branch information
bonomat authored Apr 25, 2024
2 parents ae95f73 + 0e03d9a commit fb17a16
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 18 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/testflight-for-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Daily Task

on:
schedule:
- cron: '0 0 * * *' # This will run the task every day at midnight UTC

jobs:
run_task:
name: Run Task
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: List installations Xcode version
run: sudo ls -1 /Applications | grep "Xcode"
- name: List used Xcode version
run: /usr/bin/xcodebuild -version
- name: Select different xcode version
run: sudo xcode-select -s '/Applications/Xcode_15.2.app/Contents/Developer'
- name: List used Xcode version
run: /usr/bin/xcodebuild -version

- uses: ./.github/actions/setup-fvm
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile

- name: Check cocoapods version
run: /usr/local/bin/pod --version
- name: Re-install cocoapods
run: sudo gem install cocoapods
- name: Check cocoapods version
run: /usr/local/bin/pod --version

- name: Install just
run: cargo install just --force

- name: Install fastlane
run: |
cd mobile/ios/fastlane
gem install bundler
bundle install
bundle info fastlane
- name: Put for beta testing app for review
env:
# secrets
FASTLANE_APPLE_ID: ${{ secrets.FASTLANE_APPLE_ID }}
FASTLANE_APP_STORE_CONNECT_TEAM_ID: ${{ secrets.FASTLANE_APP_STORE_CONNECT_TEAM_ID }}
FASTLANE_DEVELOPER_PORTAL_TEAM_ID: ${{ secrets.FASTLANE_DEVELOPER_PORTAL_TEAM_ID }}
FASTLANE_TEMP_KEYCHAIN_USER: ${{ secrets.FASTLANE_TEMP_KEYCHAIN_USER }}
FASTLANE_TEMP_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_TEMP_KEYCHAIN_PASSWORD }}
FASTLANE_APPLE_ISSUER_ID: ${{ secrets.FASTLANE_APPLE_ISSUER_ID }}
FASTLANE_APPLE_KEY_ID: ${{ secrets.FASTLANE_APPLE_KEY_ID }}
FASTLANE_APPLE_KEY_CONTENT: ${{ secrets.FASTLANE_APPLE_KEY_CONTENT }}
FASTLANE_GIT_AUTHORIZATION: ${{ secrets.FASTLANE_GIT_AUTHORIZATION }}
MATCH_PASSWORD: ${{ secrets.FASTLANE_MATCH_PASSWORD }}
# regtest specific settings
FASTLANE_DEVELOPER_APP_ID: ${{ secrets.FASTLANE_DEVELOPER_REGTEST_APP_ID }}
FASTLANE_DEVELOPER_APP_IDENTIFIER: finance.get10101.app.test
FASTLANE_PROVISIONING_PROFILE_SPECIFIER: match AppStore finance.get10101.app.test
FASTLANE_APP_SCHEME: test
run: |
just publish-ios-to-group
- name: Print fastlane gym logs
if: always()
run: cat /Users/runner/Library/Logs/gym/10101*.log

3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,9 @@ publish-testflight:

build-ipa-no-codesign: (build-ipa "--no-codesign")

publish-ios-to-group:
cd mobile/ios/fastlane && bundle exec fastlane add_build_to_review --verbose

publish-testflight-fastlane:
cd mobile/ios/fastlane && bundle exec fastlane closed_beta --verbose

Expand Down
42 changes: 42 additions & 0 deletions mobile/ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,46 @@ platform :ios do
delete_temp_keychain(keychain_name)
end

lane :add_build_to_review do
keychain_name = TEMP_KEYCHAIN_USER
keychain_password = TEMP_KEYCHAIN_PASSWORD
ensure_temp_keychain(keychain_name, keychain_password)

api_key = app_store_connect_api_key(
key_id: APPLE_KEY_ID,
issuer_id: APPLE_ISSUER_ID,
key_content: APPLE_KEY_CONTENT,
duration: 1200,
in_house: false
)

build_number = sh("git", "rev-list", "HEAD", "--count")

cocoapods(
clean_install: true
)

match(
type: 'appstore',
app_identifier: "#{DEVELOPER_APP_IDENTIFIER}",
git_basic_authorization: Base64.strict_encode64(GIT_AUTHORIZATION),
readonly: true,
keychain_name: keychain_name,
keychain_password: keychain_password,
api_key: api_key
)

pilot(
apple_id: "#{DEVELOPER_APP_ID}",
app_identifier: "#{DEVELOPER_APP_IDENTIFIER}",
distribute_only: true,
build_number: "#{build_number}",
groups: ["external"],
changelog: "Nightly build, check master commit history for latest changes.",
)

delete_temp_keychain(keychain_name)

end

end
41 changes: 23 additions & 18 deletions mobile/ios/fastlane/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.6)
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (6.1.7.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
Expand All @@ -14,25 +16,26 @@ GEM
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
artifactory (3.0.15)
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.888.0)
aws-sdk-core (3.191.1)
aws-partitions (1.919.0)
aws-sdk-core (3.192.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.77.0)
aws-sdk-kms (1.79.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.143.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sdk-s3 (1.147.0)
aws-sdk-core (~> 3, >= 3.192.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
claide (1.1.0)
cocoapods (1.15.2)
addressable (~> 2.8)
Expand Down Expand Up @@ -115,15 +118,15 @@ GEM
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.3.0)
fastlane (2.219.0)
fastimage (2.3.1)
fastlane (2.220.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
colored (~> 1.2)
commander (~> 4.6)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
Expand All @@ -144,10 +147,10 @@ GEM
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (>= 2.0.0, < 3.0.0)
naturally (~> 2.2)
optparse (>= 0.1.1)
optparse (>= 0.1.1, < 1.0.0)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
security (= 0.1.5)
simctl (~> 1.6.3)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (~> 3)
Expand All @@ -156,7 +159,7 @@ GEM
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
Expand Down Expand Up @@ -204,8 +207,9 @@ GEM
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jmespath (1.6.2)
json (2.7.1)
jwt (2.7.1)
json (2.7.2)
jwt (2.8.1)
base64
mini_magick (4.12.0)
mini_mime (1.1.5)
minitest (5.22.2)
Expand All @@ -216,11 +220,12 @@ GEM
nap (1.1.0)
naturally (2.2.1)
netrc (0.11.0)
optparse (0.4.0)
nkf (0.2.0)
optparse (0.5.0)
os (1.1.4)
plist (3.7.1)
public_suffix (4.0.7)
rake (13.1.0)
rake (13.2.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
Expand All @@ -231,7 +236,7 @@ GEM
ruby-macho (2.5.1)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
security (0.1.3)
security (0.1.5)
signet (0.18.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
Expand Down

0 comments on commit fb17a16

Please sign in to comment.