Skip to content

Commit

Permalink
Enable duplicate production build for testers
Browse files Browse the repository at this point in the history
  • Loading branch information
ealymbaev committed Oct 24, 2023
1 parent 628fbf0 commit 2f00a64
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy_appstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
APPLE_KEY_CONTENT: ${{ secrets.APPLE_KEY_CONTENT }}

XCCONFIG_PROD_SWAP_ENABLED: false
XCCONFIG_PROD_INFURA_PROJECT_ID: ${{ secrets.XCCONFIG_PROD_INFURA_PROJECT_ID }}
XCCONFIG_PROD_INFURA_PROJECT_SECRET: ${{ secrets.XCCONFIG_PROD_INFURA_PROJECT_SECRET }}
XCCONFIG_PROD_ETHERSCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_ETHERSCAN_API_KEY }}
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/deploy_test_flight.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Deploy Production to TestFlight Testers

on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
build_and_deploy:
name: Build and Deploy to TestFlight Testers
runs-on: macos-12

steps:
- name: Setup Xcode to 14.2
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.2'

- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Ruby v3
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.2

- name: Setup Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install Lipo via Cargo
run: cargo install cargo-lipo

- name: Add iOS targets to Rust
run: rustup target add aarch64-apple-ios x86_64-apple-ios

- name: Run Fastlane (build, upload to TestFlight)
uses: maierj/[email protected]
with:
lane: release
env:
BUILD_NUMBER: ${{ github.run_number }}.tf
APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APP_STORE_CONNECT_TEAM_ID }}
APP_ID: ${{ secrets.APP_ID }}
APP_IDENTIFIER_RELEASE: ${{ secrets.APP_IDENTIFIER_RELEASE }}
DEVELOPER_PORTAL_TEAM_ID: ${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}
FASTLANE_APPLE_ID: ${{ secrets.FASTLANE_APPLE_ID }}
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
GIT_AUTHORIZATION: ${{ secrets.GIT_AUTHORIZATION }}
PROVISIONING_PROFILE_SPECIFIER_APPSTORE: ${{ secrets.PROVISIONING_PROFILE_SPECIFIER_APPSTORE }}
TEMP_KEYCHAIN_PASSWORD: ${{ secrets.TEMP_KEYCHAIN_PASSWORD }}
TEMP_KEYCHAIN_USER: ${{ secrets.TEMP_KEYCHAIN_USER }}
APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
APPLE_KEY_CONTENT: ${{ secrets.APPLE_KEY_CONTENT }}

XCCONFIG_PROD_SWAP_ENABLED: true
XCCONFIG_PROD_INFURA_PROJECT_ID: ${{ secrets.XCCONFIG_PROD_INFURA_PROJECT_ID }}
XCCONFIG_PROD_INFURA_PROJECT_SECRET: ${{ secrets.XCCONFIG_PROD_INFURA_PROJECT_SECRET }}
XCCONFIG_PROD_ETHERSCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_ETHERSCAN_API_KEY }}
XCCONFIG_PROD_ARBISCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_ARBISCAN_API_KEY }}
XCCONFIG_PROD_OPTIMISM_ETHERSCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_OPTIMISM_ETHERSCAN_API_KEY }}
XCCONFIG_PROD_BSCSCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_BSCSCAN_API_KEY }}
XCCONFIG_PROD_POLYGONSCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_POLYGONSCAN_API_KEY }}
XCCONFIG_PROD_SNOWTRACE_API_KEY: ${{ secrets.XCCONFIG_PROD_SNOWTRACE_API_KEY }}
XCCONFIG_PROD_GNOSISSCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_GNOSISSCAN_API_KEY }}
XCCONFIG_PROD_FTMSCAN_API_KEY: ${{ secrets.XCCONFIG_PROD_FTMSCAN_API_KEY }}
XCCONFIG_PROD_DEFIYIELD_API_KEY: ${{ secrets.XCCONFIG_PROD_DEFIYIELD_API_KEY }}
XCCONFIG_PROD_TWITTER_BEARER_TOKEN: ${{ secrets.XCCONFIG_PROD_TWITTER_BEARER_TOKEN }}
XCCONFIG_PROD_HS_PROVIDER_API_KEY: ${{ secrets.XCCONFIG_PROD_HS_PROVIDER_API_KEY }}
XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY: ${{ secrets.XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY }}
XCCONFIG_PROD_OPEN_SEA_API_KEY: ${{ secrets.XCCONFIG_PROD_OPEN_SEA_API_KEY }}
XCCONFIG_PROD_TRONGRID_API_KEY: ${{ secrets.XCCONFIG_PROD_TRONGRID_API_KEY }}
XCCONFIG_PROD_UNSTOPPABLE_DOMAINS_API_KEY: ${{ secrets.XCCONFIG_PROD_UNSTOPPABLE_DOMAINS_API_KEY }}
XCCONFIG_PROD_ONE_INCH_API_KEY: ${{ secrets.XCCONFIG_PROD_ONE_INCH_API_KEY }}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ private_cloud_container_id = iCloud.io.horizontalsystems.bank-wallet.dev
open_sea_api_key =
unstoppable_domains_api_key =
one_inch_api_key =
swap_enabled = true

default_words =
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ private_cloud_container_id = iCloud.io.horizontalsystems.bank-wallet
open_sea_api_key =
unstoppable_domains_api_key =
one_inch_api_key =
swap_enabled = true
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class EvmTransactionsAdapter: BaseEvmAdapter {
case .all: ()
case .incoming: type = .incoming
case .outgoing: type = .outgoing
// case .swap: type = .swap
case .swap: type = .swap
case .approve: type = .approve
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TronTransactionsAdapter: BaseTronAdapter {
case .all: ()
case .incoming: type = .incoming
case .outgoing: type = .outgoing
// case .swap: type = .swap
case .swap: type = .swap
case .approve: type = .approve
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,8 @@ struct AppConfig {
(Bundle.main.object(forInfoDictionaryKey: "OpenSeaApiKey") as? String) ?? ""
}

static var swapEnabled: Bool {
Bundle.main.object(forInfoDictionaryKey: "SwapEnabled") as? String == "true"
}

}
4 changes: 3 additions & 1 deletion UnstoppableWallet/UnstoppableWallet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@
<string>${ShowTestNetSwitcher}</string>
<key>SnowtraceApiKey</key>
<string>${snowtrace_api_key}</string>
<key>TwitterBearerToken</key>
<key>SwapEnabled</key>
<string>${swap_enabled}</string>
<key>TwitterBearerToken</key>
<string>${twitter_bearer_token}</string>
<key>UIApplicationSceneManifest</key>
<dict>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
enum TransactionTypeFilter: String, CaseIterable {
// case all, incoming, outgoing, swap, approve
case all, incoming, outgoing, approve
enum TransactionTypeFilter: String {
case all, incoming, outgoing, swap, approve

static var allCases: [TransactionTypeFilter] {
AppConfig.swapEnabled ? [all, incoming, outgoing, swap, approve] : [all, incoming, outgoing, approve]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class WalletTokenBalanceViewItemFactory {
buttons[.send] = sendButtonState
buttons[.receive] = .enabled

if wallet.token.swappable {
if AppConfig.swapEnabled, wallet.token.swappable {
buttons[.swap] = sendButtonState
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class WalletViewItemFactory {
return [
.send: .enabled,
.receive: .enabled,
.swap: .enabled
.swap: AppConfig.swapEnabled ? .enabled : .hidden
]
case .evmAddress, .tronAddress: return [:]
}
Expand Down
2 changes: 2 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ XCCONFIG_DEV_TRONGRID_API_KEY = ENV["XCCONFIG_DEV_TRONGRID_API_KEY"]
XCCONFIG_DEV_UNSTOPPABLE_DOMAINS_API_KEY = ENV["XCCONFIG_DEV_UNSTOPPABLE_DOMAINS_API_KEY"]
XCCONFIG_DEV_ONE_INCH_API_KEY = ENV["XCCONFIG_DEV_ONE_INCH_API_KEY"]

XCCONFIG_PROD_SWAP_ENABLED = ENV["XCCONFIG_PROD_SWAP_ENABLED"]
XCCONFIG_PROD_INFURA_PROJECT_ID = ENV["XCCONFIG_PROD_INFURA_PROJECT_ID"]
XCCONFIG_PROD_INFURA_PROJECT_SECRET = ENV["XCCONFIG_PROD_INFURA_PROJECT_SECRET"]
XCCONFIG_PROD_ETHERSCAN_API_KEY = ENV["XCCONFIG_PROD_ETHERSCAN_API_KEY"]
Expand Down Expand Up @@ -129,6 +130,7 @@ def apply_dev_xcconfig
end

def apply_prod_xcconfig
update_prod_xcconfig('swap_enabled', XCCONFIG_PROD_SWAP_ENABLED)
update_prod_xcconfig('infura_project_id', XCCONFIG_PROD_INFURA_PROJECT_ID)
update_prod_xcconfig('infura_project_secret', XCCONFIG_PROD_INFURA_PROJECT_SECRET)
update_prod_xcconfig('etherscan_api_key', XCCONFIG_PROD_ETHERSCAN_API_KEY)
Expand Down

0 comments on commit 2f00a64

Please sign in to comment.