Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/mobile-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ jobs:
- name: Build and upload to App Store Connect/TestFlight
if: inputs.platform != 'android' && !env.ACT
env:
ENABLE_DEBUG_LOGS: ${{ secrets.ENABLE_DEBUG_LOGS }}
GRAFANA_LOKI_PASSWORD: ${{ secrets.GRAFANA_LOKI_PASSWORD }}
GRAFANA_LOKI_URL: ${{ secrets.GRAFANA_LOKI_URL }}
GRAFANA_LOKI_USERNAME: ${{ secrets.GRAFANA_LOKI_USERNAME }}
IOS_APP_IDENTIFIER: ${{ secrets.IOS_APP_IDENTIFIER }}
IOS_CONNECT_API_KEY_BASE64: ${{ secrets.IOS_CONNECT_API_KEY_BASE64 }}
IOS_CONNECT_API_KEY_PATH: ${{ env.APP_PATH }}${{ env.IOS_CONNECT_API_KEY_PATH }}
Expand All @@ -493,14 +497,13 @@ jobs:
IOS_PROV_PROFILE_NAME: ${{ secrets.IOS_PROV_PROFILE_NAME }}
IOS_PROV_PROFILE_PATH: ${{ env.IOS_PROV_PROFILE_PATH }}
IOS_SIGNING_CERTIFICATE: ${{ secrets.IOS_SIGNING_CERTIFICATE }}
IOS_TESTFLIGHT_GROUPS: ${{ secrets.IOS_TESTFLIGHT_GROUPS }}
IOS_TEAM_ID: ${{ secrets.IOS_TEAM_ID }}
IOS_TEAM_NAME: ${{ secrets.IOS_TEAM_NAME }}
IOS_TESTFLIGHT_GROUPS: ${{ secrets.IOS_TESTFLIGHT_GROUPS }}
NODE_OPTIONS: "--max-old-space-size=8192"
SEGMENT_KEY: ${{ secrets.SEGMENT_KEY }}
SELFXYZ_INTERNAL_REPO_PAT: ${{ secrets.SELFXYZ_INTERNAL_REPO_PAT }}
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_ANNOUNCE_CHANNEL_NAME: ${{ secrets.SLACK_ANNOUNCE_CHANNEL_NAME }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
timeout-minutes: 90
run: |
cd ${{ env.APP_PATH }}
Expand Down Expand Up @@ -887,13 +890,20 @@ jobs:
- name: Build AAB with Fastlane
if: inputs.platform != 'ios'
env:
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEYSTORE_PATH: ${{ env.APP_PATH }}${{ env.ANDROID_KEYSTORE_PATH }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_PACKAGE_NAME: ${{ secrets.ANDROID_PACKAGE_NAME }}
ENABLE_DEBUG_LOGS: ${{ secrets.ENABLE_DEBUG_LOGS }}
GOOGLE_SIGNIN_ANDROID_CLIENT_ID: ${{ secrets.GOOGLE_SIGNIN_ANDROID_CLIENT_ID }}
GRAFANA_LOKI_PASSWORD: ${{ secrets.GRAFANA_LOKI_PASSWORD }}
GRAFANA_LOKI_URL: ${{ secrets.GRAFANA_LOKI_URL }}
GRAFANA_LOKI_USERNAME: ${{ secrets.GRAFANA_LOKI_USERNAME }}
NODE_OPTIONS: "--max-old-space-size=6144"
SEGMENT_KEY: ${{ secrets.SEGMENT_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
run: |
cd ${{ env.APP_PATH }}

Expand All @@ -914,11 +924,7 @@ jobs:
--verbose

- name: Upload to Google Play Store using WIF
if: inputs.platform != 'ios' && (inputs.test_mode != true)
env:
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_ANNOUNCE_CHANNEL_NAME: ${{ secrets.SLACK_ANNOUNCE_CHANNEL_NAME }}
if: inputs.platform != 'ios' && inputs.test_mode != true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix test_mode guard to prevent unintended store uploads.

Switching the Upload to Google Play gate to inputs.test_mode != true breaks the skip logic for manual runs: boolean inputs from workflow_dispatch surface as the string 'true', so 'true' != true evaluates to true and the upload still fires even when the checkbox is enabled. We now risk publishing to Play Store despite requesting test mode. Align the comparison so it short-circuits for both string and boolean representations before proceeding with the upload. (github.com)

-        if: inputs.platform != 'ios' && inputs.test_mode != true
+        if: inputs.platform != 'ios' && !(inputs.test_mode == 'true' || inputs.test_mode == true)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if: inputs.platform != 'ios' && inputs.test_mode != true
if: inputs.platform != 'ios' && !(inputs.test_mode == 'true' || inputs.test_mode == true)
🤖 Prompt for AI Agents
In .github/workflows/mobile-deploy.yml around line 927, the condition uses
inputs.test_mode != true which fails for workflow_dispatch string inputs; update
the guard to short-circuit for both string and boolean representations (e.g.,
check that inputs.test_mode is neither the boolean true nor the string 'true'
before proceeding) so the Upload to Google Play step is skipped when test_mode
is enabled in manual runs.

run: |
cd ${{ env.APP_PATH }}

Expand Down
46 changes: 0 additions & 46 deletions app/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,6 @@ platform :ios do
if result[:should_upload]
Fastlane::Helpers.update_deployment_timestamp("ios")
end

# Notify Slack about the new build
if ENV["SLACK_CHANNEL_ID"] && !test_mode
deploy_source = Fastlane::Helpers.is_ci_environment? ? "GitHub Workflow" : "Local Deploy"
Fastlane::Helpers.upload_file_to_slack(
file_path: result[:ipa_path],
channel_id: ENV["SLACK_CHANNEL_ID"],
initial_comment: "🍎 iOS v#{package_version} (Build #{result[:build_number]}) deployed to TestFlight via #{deploy_source}",
title: "#{APP_NAME}-#{package_version}-#{result[:build_number]}.ipa",
)
elsif test_mode
UI.important("🧪 TEST MODE: Skipping Slack notification")
else
UI.important("Skipping Slack notification: SLACK_CHANNEL_ID not set.")
end
end

desc "Deploy iOS app with automatic version management"
Expand Down Expand Up @@ -158,19 +143,6 @@ platform :ios do
if result[:should_upload] && !test_mode
Fastlane::Helpers.update_deployment_timestamp("ios")
end

# Slack notification
if ENV["SLACK_CHANNEL_ID"] && !test_mode
deploy_source = Fastlane::Helpers.is_ci_environment? ? "GitHub Actions (Auto)" : "Local Deploy"
track_emoji = deployment_track == "production" ? "🚀" : "🧪"

Fastlane::Helpers.upload_file_to_slack(
file_path: result[:ipa_path],
channel_id: ENV["SLACK_CHANNEL_ID"],
initial_comment: "#{track_emoji} iOS v#{package_version} (Build #{result[:build_number]}) deployed to #{deployment_track} via #{deploy_source}",
title: "#{APP_NAME}-#{package_version}-#{result[:build_number]}.ipa",
)
end
end

private_lane :prepare_ios_build do |options|
Expand Down Expand Up @@ -477,23 +449,5 @@ platform :android do
if should_upload
Fastlane::Helpers.update_deployment_timestamp("android")
end

# Notify Slack about the new build
if ENV["SLACK_CHANNEL_ID"] && !test_mode
deploy_source = Fastlane::Helpers.is_ci_environment? ? "GitHub Actions (Auto)" : "Local Deploy"
deployment_track = options[:deployment_track] || options[:track]
track_emoji = deployment_track == "production" ? "🚀" : "🧪"

Fastlane::Helpers.upload_file_to_slack(
file_path: android_aab_path,
channel_id: ENV["SLACK_CHANNEL_ID"],
initial_comment: "#{track_emoji} Android v#{package_version} (Build #{version_code}) deployed to #{deployment_track || target_platform} via #{deploy_source}",
title: "#{APP_NAME}-#{package_version}-#{version_code}.aab",
)
elsif test_mode
UI.important("🧪 TEST MODE: Skipping Slack notification")
else
UI.important("Skipping Slack notification: SLACK_CHANNEL_ID not set.")
end
end
end
2 changes: 0 additions & 2 deletions app/fastlane/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@
require_relative "helpers/common"
require_relative "helpers/ios"
require_relative "helpers/android"
require_relative "helpers/slack"
require_relative "helpers/version_manager"

module Fastlane
module Helpers
extend Fastlane::Helpers::Common
extend Fastlane::Helpers::IOS
extend Fastlane::Helpers::Android
extend Fastlane::Helpers::Slack
extend Fastlane::Helpers::VersionManager
end
end
Expand Down
Loading