switch secrets to loading from env - towards a more unified way of handling secrets
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m42s
Build and release debug APK / Build APK (pull_request) Has been cancelled
Build and deploy the backend to staging / Deploy to staging (pull_request) Has been cancelled

This commit is contained in:
2024-12-13 15:05:18 +01:00
parent f25355ee3e
commit 4a542a4a1f
6 changed files with 127 additions and 27 deletions

View File

@@ -1,5 +1,6 @@
import UIKit
import Flutter
import GoogleMaps
@main
@objc class AppDelegate: FlutterAppDelegate {
@@ -7,6 +8,9 @@ import Flutter
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// load the key from env
let key = ProcessInfo.processInfo.environment["GOOGLE_MAPS_API_KEY"]!
GMSServices.provideAPI(key)
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

View File

@@ -1,5 +1,3 @@
default_platform(:ios)
platform :ios do
@@ -10,16 +8,19 @@ platform :ios do
desc "Load the App Store Connect API token"
lane :load_asc_api_token do
app_store_connect_api_key(
key_id: ENV["ASC_KEY_ID"],
issuer_id: ENV["ASC_ISSUER_ID"],
key_content: ENV["ASC_KEY_P8"],
key_id: ENV["IOS_ASC_KEY_ID"],
issuer_id: ENV["IOS_ASC_ISSUER_ID"],
key_content: ENV["IOS_ASC_KEY_P8"],
is_key_content_base64: true,
in_house: false
)
end
desc "Push a new beta build to TestFlight"
desc "Deploy a new version to closed testing (testflight)"
lane :deploy_testing do
build_name = ENV["BUILD_NAME"]
build_number = ENV["BUILD_NUMBER"]
api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
sync_code_signing(
api_key: api_key,
@@ -32,16 +33,58 @@ platform :ios do
"build",
"ipa",
"--release",
"--build-name=1.0.10",
"--build-number=4"
"--build-name=#{build_name}",
"--build-number=#{build_number}",
)
# sign the app (whithout rebuilding it)
build_app(
skip_build_archive: true,
archive_path: "../build/ios/archive/Runner.xarchive"
)
upload_to_testflight
end
desc "Deploy a new version as a full release"
lane :deploy_release do
build_name = ENV["BUILD_NAME"]
build_number = ENV["BUILD_NUMBER"]
api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
sync_code_signing(
api_key: api_key,
type: "appstore",
readonly: true,
)
sh(
"flutter",
"build",
"ipa",
"--release",
"--build-name=#{build_name}",
"--build-number=#{build_number}",
)
# sign the app (whithout rebuilding it)
build_app(
skip_build_archive: true,
archive_path: "../build/ios/archive/Runner.xarchive"
)
upload_to_app_store(
skip_screenshots: true,
skip_metadata: true,
skip_app_rating_config: true,
skip_app_review_information: true,
skip_submission: false,
# automatically submit the app for review
automatic_release: true,
# automatically release the app after review
)
end