I create an empty flutter project using Flutter 3.0.0 (also tried 2.10.5).
I can build it, run it on my iPhone and archive the app from the command line.
When running the same commands through Github Actions Im unable to archive my app.
The same machine is hooked up to Github Actions as a self-hosted runner.
Im using XCode 13.4, but also tried XCode 13.0.
The command I run locally and through Github Actions is: flutter build ipa --target=lib/main.dart --release --obfuscate --split-debug-info --build-number=${{github.run_number}} -v
When running it on Github Actions with verbose turned on this is the output: https://paste.ee/p/ernDZ
If you search for "Failed", the second hit gives this and it might be a hint:
Target release_unpack_ios failed: Exception: Failed to codesign /Users/john/Library/Developer/Xcode/DerivedData/Runner-bfrqxpkjfhgyupczrlqcnaiaydrh/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Flutter.framework/Flutter with identity XXXXXXX