mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 15:20:55 +01:00
Merge branch 'master' into drag
This commit is contained in:
commit
d0fdb6b28d
3 changed files with 53 additions and 51 deletions
1
.github/workflows/build-release-apk.yml
vendored
1
.github/workflows/build-release-apk.yml
vendored
|
@ -97,6 +97,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: signed-apk
|
name: signed-apk
|
||||||
path: ${{ env.APK_PATH }}
|
path: ${{ env.APK_PATH }}
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
browserstack:
|
browserstack:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -41,37 +41,37 @@ platform :android do
|
||||||
Dir.chdir(project_root) do
|
Dir.chdir(project_root) do
|
||||||
build_number = ENV['BUILD_NUMBER']
|
build_number = ENV['BUILD_NUMBER']
|
||||||
UI.user_error!("BUILD_NUMBER environment variable is missing") if build_number.nil?
|
UI.user_error!("BUILD_NUMBER environment variable is missing") if build_number.nil?
|
||||||
|
|
||||||
# Extract versionName from build.gradle
|
# Extract versionName from build.gradle
|
||||||
version_name = sh("grep versionName android/app/build.gradle | awk '{print $2}' | tr -d '\"'").strip
|
version_name = sh("grep versionName android/app/build.gradle | awk '{print $2}' | tr -d '\"'").strip
|
||||||
|
UI.user_error!("Failed to extract versionName from build.gradle") if version_name.nil? || version_name.empty?
|
||||||
|
|
||||||
# Update versionCode in build.gradle
|
# Update versionCode in build.gradle
|
||||||
UI.message("Updating versionCode in build.gradle to #{build_number}...")
|
UI.message("Updating versionCode in build.gradle to #{build_number}...")
|
||||||
build_gradle_path = "android/app/build.gradle"
|
build_gradle_path = "android/app/build.gradle"
|
||||||
build_gradle_contents = File.read(build_gradle_path)
|
build_gradle_contents = File.read(build_gradle_path)
|
||||||
new_build_gradle_contents = build_gradle_contents.gsub(/versionCode\s+\d+/, "versionCode #{build_number}")
|
new_build_gradle_contents = build_gradle_contents.gsub(/versionCode\s+\d+/, "versionCode #{build_number}")
|
||||||
File.write(build_gradle_path, new_build_gradle_contents)
|
File.write(build_gradle_path, new_build_gradle_contents)
|
||||||
|
|
||||||
# Determine branch name
|
# Determine branch name and sanitize it
|
||||||
branch_name = ENV['GITHUB_HEAD_REF'] || `git rev-parse --abbrev-ref HEAD`.strip.gsub(/[\/\\:?*"<>|]/, '_')
|
branch_name = ENV['GITHUB_HEAD_REF'] || `git rev-parse --abbrev-ref HEAD`.strip
|
||||||
|
branch_name = branch_name.gsub(/[^a-zA-Z0-9_-]/, '_') # Replace non-alphanumeric characters with underscore
|
||||||
branch_name = 'master' if branch_name.nil? || branch_name.empty?
|
branch_name = 'master' if branch_name.nil? || branch_name.empty?
|
||||||
|
|
||||||
# Define APK name based on branch
|
|
||||||
signed_apk_name = branch_name != 'master' ? "BlueWallet-#{version_name}-#{build_number}-#{branch_name}.apk" : "BlueWallet-#{version_name}-#{build_number}.apk"
|
|
||||||
|
|
||||||
# Build APK
|
|
||||||
UI.message("Building APK...")
|
|
||||||
sh("cd android && ./gradlew assembleRelease")
|
|
||||||
UI.message("APK build completed.")
|
|
||||||
|
|
||||||
# Define APK name based on branch
|
# Define APK name based on branch
|
||||||
signed_apk_name = branch_name != 'master' ?
|
signed_apk_name = branch_name != 'master' ?
|
||||||
"BlueWallet-#{version_name}-#{build_number}-#{branch_name}".gsub(/[\/\\:?*"<>|]/, '_') + ".apk" :
|
"BlueWallet-#{version_name}-#{build_number}-#{branch_name}.apk" :
|
||||||
"BlueWallet-#{version_name}-#{build_number}.apk"
|
"BlueWallet-#{version_name}-#{build_number}.apk"
|
||||||
|
|
||||||
# Define paths
|
# Define paths
|
||||||
unsigned_apk_path = "android/app/build/outputs/apk/release/app-release-unsigned.apk"
|
unsigned_apk_path = "android/app/build/outputs/apk/release/app-release-unsigned.apk"
|
||||||
signed_apk_path = "android/app/build/outputs/apk/release/#{signed_apk_name}"
|
signed_apk_path = "android/app/build/outputs/apk/release/#{signed_apk_name}"
|
||||||
|
|
||||||
|
# Build APK
|
||||||
|
UI.message("Building APK...")
|
||||||
|
sh("cd android && ./gradlew assembleRelease --no-daemon")
|
||||||
|
UI.message("APK build completed.")
|
||||||
|
|
||||||
# Rename APK
|
# Rename APK
|
||||||
if File.exist?(unsigned_apk_path)
|
if File.exist?(unsigned_apk_path)
|
||||||
UI.message("Renaming APK to #{signed_apk_name}...")
|
UI.message("Renaming APK to #{signed_apk_name}...")
|
||||||
|
@ -81,14 +81,16 @@ platform :android do
|
||||||
UI.error("Unsigned APK not found at path: #{unsigned_apk_path}")
|
UI.error("Unsigned APK not found at path: #{unsigned_apk_path}")
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sign APK
|
# Sign APK
|
||||||
UI.message("Signing APK with apksigner...")
|
UI.message("Signing APK with apksigner...")
|
||||||
apksigner_path = "#{ENV['ANDROID_HOME']}/build-tools/34.0.0/apksigner"
|
apksigner_path = Dir.glob("#{ENV['ANDROID_HOME']}/build-tools/*/apksigner").sort.last
|
||||||
|
UI.user_error!("apksigner not found in Android build-tools") if apksigner_path.nil? || apksigner_path.empty?
|
||||||
sh("#{apksigner_path} sign --ks #{project_root}/bluewallet-release-key.keystore --ks-pass=pass:#{ENV['KEYSTORE_PASSWORD']} #{signed_apk_path}")
|
sh("#{apksigner_path} sign --ks #{project_root}/bluewallet-release-key.keystore --ks-pass=pass:#{ENV['KEYSTORE_PASSWORD']} #{signed_apk_path}")
|
||||||
UI.message("APK signed successfully: #{signed_apk_path}")
|
UI.message("APK signed successfully: #{signed_apk_path}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
desc "Upload APK to BrowserStack and post result as PR comment"
|
desc "Upload APK to BrowserStack and post result as PR comment"
|
||||||
lane :upload_to_browserstack_and_comment do
|
lane :upload_to_browserstack_and_comment do
|
||||||
|
@ -591,5 +593,4 @@ lane :update_release_notes do |options|
|
||||||
UI.error("No localization found for locale #{locale}")
|
UI.error("No localization found for locale #{locale}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
|
@ -243,27 +243,6 @@ const DetailViewStackScreensStack = () => {
|
||||||
component={WalletAddresses}
|
component={WalletAddresses}
|
||||||
options={navigationStyle({ title: loc.addresses.addresses_title, statusBarStyle: 'auto' })(theme)}
|
options={navigationStyle({ title: loc.addresses.addresses_title, statusBarStyle: 'auto' })(theme)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<DetailViewStack.Screen
|
|
||||||
name="AddWalletRoot"
|
|
||||||
component={AddWalletStack}
|
|
||||||
options={navigationStyle({ closeButtonPosition: CloseButtonPosition.Left, ...NavigationFormModalOptions })(theme)}
|
|
||||||
/>
|
|
||||||
<DetailViewStack.Screen name="SendDetailsRoot" component={SendDetailsStack} options={NavigationFormModalOptions} />
|
|
||||||
<DetailViewStack.Screen name="LNDCreateInvoiceRoot" component={LNDCreateInvoiceRoot} options={NavigationDefaultOptions} />
|
|
||||||
<DetailViewStack.Screen name="ScanLndInvoiceRoot" component={ScanLndInvoiceRoot} options={NavigationDefaultOptions} />
|
|
||||||
<DetailViewStack.Screen name="AztecoRedeemRoot" component={AztecoRedeemStackRoot} options={NavigationDefaultOptions} />
|
|
||||||
{/* screens */}
|
|
||||||
<DetailViewStack.Screen
|
|
||||||
name="WalletExportRoot"
|
|
||||||
component={WalletExportStack}
|
|
||||||
options={{ ...NavigationDefaultOptions, ...StatusBarLightOptions }}
|
|
||||||
/>
|
|
||||||
<DetailViewStack.Screen
|
|
||||||
name="ExportMultisigCoordinationSetupRoot"
|
|
||||||
component={ExportMultisigCoordinationSetupStack}
|
|
||||||
options={NavigationDefaultOptions}
|
|
||||||
/>
|
|
||||||
<DetailViewStack.Screen
|
<DetailViewStack.Screen
|
||||||
name="Settings"
|
name="Settings"
|
||||||
component={Settings}
|
component={Settings}
|
||||||
|
@ -341,12 +320,43 @@ const DetailViewStackScreensStack = () => {
|
||||||
component={SettingsPrivacy}
|
component={SettingsPrivacy}
|
||||||
options={navigationStyle({ title: loc.settings.privacy })(theme)}
|
options={navigationStyle({ title: loc.settings.privacy })(theme)}
|
||||||
/>
|
/>
|
||||||
|
<DetailViewStack.Screen
|
||||||
|
name="ScanQRCode"
|
||||||
|
component={ScanQRCodeComponent}
|
||||||
|
options={navigationStyle({
|
||||||
|
headerShown: false,
|
||||||
|
statusBarHidden: true,
|
||||||
|
presentation: 'fullScreenModal',
|
||||||
|
headerShadowVisible: false,
|
||||||
|
})(theme)}
|
||||||
|
/>
|
||||||
<DetailViewStack.Screen
|
<DetailViewStack.Screen
|
||||||
name="ViewEditMultisigCosignersRoot"
|
name="ViewEditMultisigCosignersRoot"
|
||||||
component={ViewEditMultisigCosignersStackRoot}
|
component={ViewEditMultisigCosignersStackRoot}
|
||||||
options={{ ...NavigationDefaultOptions, ...StatusBarLightOptions, gestureEnabled: false, fullScreenGestureEnabled: false }}
|
options={{ ...NavigationDefaultOptions, ...StatusBarLightOptions, gestureEnabled: false, fullScreenGestureEnabled: false }}
|
||||||
initialParams={{ walletID: undefined, cosigners: undefined }}
|
initialParams={{ walletID: undefined, cosigners: undefined }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<DetailViewStack.Screen
|
||||||
|
name="AddWalletRoot"
|
||||||
|
component={AddWalletStack}
|
||||||
|
options={navigationStyle({ closeButtonPosition: CloseButtonPosition.Left, ...NavigationFormModalOptions })(theme)}
|
||||||
|
/>
|
||||||
|
<DetailViewStack.Screen name="SendDetailsRoot" component={SendDetailsStack} options={NavigationFormModalOptions} />
|
||||||
|
<DetailViewStack.Screen name="LNDCreateInvoiceRoot" component={LNDCreateInvoiceRoot} options={NavigationDefaultOptions} />
|
||||||
|
<DetailViewStack.Screen name="ScanLndInvoiceRoot" component={ScanLndInvoiceRoot} options={NavigationDefaultOptions} />
|
||||||
|
<DetailViewStack.Screen name="AztecoRedeemRoot" component={AztecoRedeemStackRoot} options={NavigationDefaultOptions} />
|
||||||
|
{/* screens */}
|
||||||
|
<DetailViewStack.Screen
|
||||||
|
name="WalletExportRoot"
|
||||||
|
component={WalletExportStack}
|
||||||
|
options={{ ...NavigationDefaultOptions, ...StatusBarLightOptions }}
|
||||||
|
/>
|
||||||
|
<DetailViewStack.Screen
|
||||||
|
name="ExportMultisigCoordinationSetupRoot"
|
||||||
|
component={ExportMultisigCoordinationSetupStack}
|
||||||
|
options={NavigationDefaultOptions}
|
||||||
|
/>
|
||||||
<DetailViewStack.Screen
|
<DetailViewStack.Screen
|
||||||
name="WalletXpubRoot"
|
name="WalletXpubRoot"
|
||||||
component={WalletXpubStackRoot}
|
component={WalletXpubStackRoot}
|
||||||
|
@ -369,16 +379,6 @@ const DetailViewStackScreensStack = () => {
|
||||||
statusBarStyle: 'auto',
|
statusBarStyle: 'auto',
|
||||||
})(theme)}
|
})(theme)}
|
||||||
/>
|
/>
|
||||||
<DetailViewStack.Screen
|
|
||||||
name="ScanQRCode"
|
|
||||||
component={ScanQRCodeComponent}
|
|
||||||
options={navigationStyle({
|
|
||||||
headerShown: false,
|
|
||||||
statusBarHidden: true,
|
|
||||||
presentation: 'fullScreenModal',
|
|
||||||
headerShadowVisible: false,
|
|
||||||
})(theme)}
|
|
||||||
/>
|
|
||||||
</DetailViewStack.Navigator>
|
</DetailViewStack.Navigator>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue