From 237a7ce3ffcd084b86427c199111c7159711e61b Mon Sep 17 00:00:00 2001 From: yf L Date: Thu, 25 Feb 2021 14:33:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:.=E4=BF=AE=E5=A4=8DNeed=20to=20acknowledge?= =?UTF-8?q?=20to=20Apple's=20Apple=20ID=20and=20Privacy=20statement?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8Chttps://docs.fastlane.tools/app-stor?= =?UTF-8?q?e-connect-api/=E4=BD=BF=E7=94=A8apple=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=9A=84api=E8=AE=BF=E9=97=AE=E7=A7=98=E9=92=A5!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dart.yml | 3 ++- ios/fastlane/Fastfile | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 9272019..cd8cff0 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -138,8 +138,9 @@ jobs: MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} PGY_API_KEY: ${{ secrets.PGY_API_KEY }} PGY_USER_KEY: ${{ secrets.PGY_USER_KEY }} - APPLE_AUTH_KEY: ${{ secrets.APPLE_AUTH_KEY }} + APPLE_AUTH_JSON_KEY: ${{ secrets.APPLE_AUTH_JSON_KEY }} APPLE_AUTH_P8_KEY: ${{ secrets.APPLE_AUTH_P8_KEY }} + APPLE_AUTH_P8_BASE64_KEY: ${{ secrets.APPLE_AUTH_P8_BASE64_KEY }} MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} BUILD_REVISION: ${{ steps.CURRENT_TAG_OR_TAG.outputs.BUILD_REVISION }} run: sh ./ios/build.sh diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index c53141c..c4d4f1a 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -50,8 +50,9 @@ $env_key_fabric_api_token = 'FABRIC_API_TOKEN' $env_key_fabric_build_secret = 'FABRIC_BUILD_SECRET' $env_key_fastlane_match_basic_auth = 'MATCH_GIT_BASIC_AUTHORIZATION' # fastlane打包上传ipa到app-store-connect需要使用最新授权方式(https://docs.fastlane.tools/app-store-connect-api/) -$env_key_fastlane_apple_auth_key = 'APPLE_AUTH_KEY' +$env_key_fastlane_apple_auth_json_key = 'APPLE_AUTH_JSON_KEY' $env_key_fastlane_apple_auth_p8_key = 'APPLE_AUTH_P8_KEY' +$env_key_fastlane_apple_auth_p8_base64_key = 'APPLE_AUTH_P8_BASE64_KEY' $path_dir_build = ENV[$env_key_mobile_root] $current_branch = ENV[$env_current_branch] @@ -153,7 +154,7 @@ platform :ios do # ) if should_pilot File.open($path_file_apple_auth_json, "w") do |file| - file.write(JSON.pretty_generate("#{ENV[$env_key_fastlane_apple_auth_key]}").gsub('\n', '\\n')) + file.write(JSON.pretty_generate("#{ENV[$env_key_fastlane_apple_auth_json_key]}").gsub('\n', '\\n')) end Dir.chdir($path_dir_ios) do sh('ls -lh') @@ -166,10 +167,12 @@ platform :ios do sh('ls -lh') sh('cat',$path_file_apple_auth_p8) end + # key_filepath: $path_file_apple_auth_p8, api_key = app_store_connect_api_key( key_id: "YU2873TJJ5", issuer_id: "69a6de89-d0ae-47e3-e053-5b8c7c11a4d1", - key_filepath: $path_file_apple_auth_p8, + key_content: "#{ENV[$env_key_fastlane_apple_auth_p8_base64_key]}", + is_key_content_base64: true, duration: 1200, in_house: false )