This is taken from my app koja.works, as an attempt to get full notarized + appstore builds made in a single CI workflow so that I can keep track of all moving parts, without involving Fastlane (which in my experience breaks way too often due to system rubies etc).
Builds for both Mac and visionOS, and the vision file is probably easily extensible to iOS as well (maybe with matrix builds?)
I'm using a self-hosted Mac mini on my desktop, which is why I have to fiddle with PATH etc. I'm doing this because I require metal support during build, which Xcode Cloud does not support.