From 9b031391a372c201eb9ac47d92198d81eca6ed13 Mon Sep 17 00:00:00 2001 From: u221711 Date: Mon, 5 Aug 2024 14:41:19 +0200 Subject: [PATCH] add signing --- .github/workflows/flutter_ios_build.yml | 59 +++++++++---------------- das_client/README.md | 2 +- 2 files changed, 21 insertions(+), 40 deletions(-) diff --git a/.github/workflows/flutter_ios_build.yml b/.github/workflows/flutter_ios_build.yml index 3fbfcb30..2b1bb7ae 100644 --- a/.github/workflows/flutter_ios_build.yml +++ b/.github/workflows/flutter_ios_build.yml @@ -32,58 +32,39 @@ jobs: flutter-version: '3.22.2' - name: Install the Apple certificate and provisioning profile env: - SBB_APPSTORE_BASE64: ${{ secrets.SBB_APPSTORE_BASE64 }} - SBB_APPSTORE_P12_PASSWORD: ${{ secrets.SBB_APPSTORE_P12_PASSWORD }} - DEV_BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.DEV_BUILD_PROVISION_PROFILE_BASE64 }} - INT_BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.INT_BUILD_PROVISION_PROFILE_BASE64 }} - PROD_BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.PROD_BUILD_PROVISION_PROFILE_BASE64 }} - KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} +# KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + APPSTORE_CONNECT_PRIVATE_KEY_BASE64: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY_BASE64 }} + APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }} run: | # create variables - SBB_CERTIFICATE_PATH=$RUNNER_TEMP/sbb_appstore.p12 - PP_DEV_PATH=$RUNNER_TEMP/build_dev_pp.mobileprovision - PP_INT_PATH=$RUNNER_TEMP/build_int_pp.mobileprovision - PP_PROD_PATH=$RUNNER_TEMP/build_prod_pp.mobileprovision - KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db +# KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + APPSTORE_CONNECT_PRIVATE_KEY_PATH=~/PrivateKeys/AuthKey_$APPSTORE_CONNECT_KEY_ID.p8 # import certificate and provisioning profile from secrets - echo -n "$SBB_APPSTORE_BASE64" | base64 --decode -o $SBB_CERTIFICATE_PATH - echo -n "$DEV_BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_DEV_PATH - echo -n "$INT_BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_INT_PATH - echo -n "$PROD_BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PROD_PATH + echo -n "$APPSTORE_CONNECT_PRIVATE_KEY_BASE64" | base64 --decode -o $APPSTORE_CONNECT_PRIVATE_KEY_PATH # create temporary keychain - security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH +# security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH +# security set-keychain-settings -lut 21600 $KEYCHAIN_PATH +# security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH # import certificate to keychain - security import $SBB_CERTIFICATE_PATH -P "$SBB_APPSTORE_P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH - - # apply provisioning profile - mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_DEV_PATH ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_INT_PATH ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PROD_PATH ~/Library/MobileDevice/Provisioning\ Profiles +# security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH +# security list-keychain -d user -s $KEYCHAIN_PATH - run: | flutter pub get flutter pub run build_runner build --delete-conflicting-outputs - run: flutter test -# - run: flutter build ipa --flavor dev -t lib/main_dev.dart --release --export-options-plist=ios/exportOptionsRelease.plist - - run: flutter build ios --flavor dev -t lib/main_dev.dart --release - - run: xcodebuild -exportArchive -archivePath "build/ios/iphoneos/DAS Dev.app" -exportPath "build/ios/ipa/" -exportOptionsPlist ios/exportOptionsRelease.plist + - name: Build and Deploy iOS App + env: + APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }} + APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }} + run: | + flutter build ipa --flavor inte -t lib/main_inte.dart --release --no-codesign + xcodebuild -exportArchive -archivePath "build/ios/archive/DAS Inte.xcarchive" -exportOptionsPlist ios/exportOptionsRelease.plist -allowProvisioningUpdates -authenticationKeyIssuerID $APPSTORE_CONNECT_ISSUER_ID -authenticationKeyID $APPSTORE_CONNECT_KEY_ID -authenticationKeyPath ~/PrivateKeys/AuthKey_$APPSTORE_CONNECT_KEY_ID.p8 +# - run: flutter build ios --flavor dev -t lib/main_dev.dart --release # - run: flutter build ios --flavor dev -t lib/main_dev.dart --release # - run: flutter build ios --flavor inte -t lib/main_inte.dart --release # - run: flutter build ios --flavor prod -t lib/main_prod.dart --release - - name: Archive Apps - uses: actions/upload-artifact@v4 - with: - name: Build - path: | - das_client/build/ios/archive/** - das_client/build/ios/ipa/** - das_client/build/ios/iphoneos/** - retention-days: 1 + diff --git a/das_client/README.md b/das_client/README.md index 48963477..c3e96850 100644 --- a/das_client/README.md +++ b/das_client/README.md @@ -13,4 +13,4 @@ A few resources to get you started if this is your first Flutter project: For help getting started with Flutter development, view the [online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. \ No newline at end of file +samples, guidance on mobile development, and a full API reference.