为多通道自动化快速通道身份验证

Automating Fastlane Authentication for multiple lanes

我正在尝试设置 Fastfile 以上传到 Testflight 并交付,但无缘无故,我无法为 app_store_connect_api_key 分享我的 lane_context。这是我的 Fastfile,我错了。

platform :ios do
   desc "Load ASC API Key information to use in subsequent lanes"
   lane :app_store_connect_api_key do
       app_store_connect_api_key(
       key_id: "key_id",
       issuer_id: "issuerid",
       key_content: "content",
       is_key_content_base64: true,
       duration: 500,
       in_house: false
     )
end
end
  desc "Test auth"
  lane :release do
     app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
     api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
     pilot(
     api_key: api_key,
     app_identifier: app_identifier,
     skip_submission: true,
     skip_waiting_for_build_processing: true
   )
end

当我尝试执行我收到的 Fastlane 版本时。谢谢!

在车道上下文中使用 API 键之前,您需要执行 app_store_connect_api_key。如下所示:

platform :ios do
   desc "Load ASC API Key information to use in subsequent lanes"
   lane :retrieve_api_key do
       app_store_connect_api_key(
       key_id: "key_id",
       issuer_id: "issuerid",
       key_content: "content",
       is_key_content_base64: true,
       duration: 500,
       in_house: false
     )
end
end
  desc "Test auth"
  lane :release do
     retrieve_api_key
     app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
     api_key = lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
     pilot(
     api_key: api_key,
     app_identifier: app_identifier,
     skip_submission: true,
     skip_waiting_for_build_processing: true
   )
end