cedvdb / action-flutter-build-ios

Github action that sets up a macos environment to build an ios app
MIT License
22 stars 7 forks source link

Need to add a cleanup step to delete keychain, so subsequent builds work #5

Open naresh-fluidra opened 1 month ago

naresh-fluidra commented 1 month ago

When trying to build multi flavour app - subsequent builds fail because of existing keychain

- uses: cedvdb/action-flutter-build-ios@v1 with: build-cmd: flutter build ipa --release --flavor debug -t lib/main_debug.dart --export-options-plist=ios/debug.plist certificate-base64: ${{ secrets.PS_BUILD_CERTIFICATE_BASE64 }} certificate-password: ${{ secrets.PS_P12_PASSWORD }} provisioning-profile-base64: ${{ secrets.PS_BUILD_PROVISION_PROFILE_BASE64 }} keychain-password: ${{ secrets.PS_KEYCHAIN_PASSWORD }}

- uses: cedvdb/action-flutter-build-ios@v1 with: build-cmd: flutter build ipa --release --flavor release -t lib/main_release.dart --export-options-plist=ios/release.plist certificate-base64: ${{ secrets.PS_BUILD_CERTIFICATE_BASE64 }} certificate-password: ${{ secrets.PS_P12_PASSWORD }} provisioning-profile-base64: ${{ secrets.PS_BUILD_PROVISION_PROFILE_BASE64 }} keychain-password: ${{ secrets.SD_KEYCHAIN_PASSWORD }}

Even when a different keychain password is used, it will not override. So need to delete the existing keychain

- name: Delete keychain if: always() # Always run this step to ensure the keychain is properly disposed of run: | security delete-keychain "${{ KEYCHAIN_PATH }}"

cedvdb commented 1 month ago

PR's are welcome