diff --git a/.github/workflows/xcodebuild-or-fastlane.yml b/.github/workflows/xcodebuild-or-fastlane.yml index 5e8222b..724b197 100644 --- a/.github/workflows/xcodebuild-or-fastlane.yml +++ b/.github/workflows/xcodebuild-or-fastlane.yml @@ -42,7 +42,7 @@ on: type: string default: 'platform=iOS Simulator,name=iPhone 15 Pro' setupSimulators: - description: 'Flag indicating if all iOS simulators matching the `destination` input shoud be setup (e.g. password autofill functionality should be disabled).' + description: 'Flag indicating if all iOS simulators matching the `destination` input should be setup (e.g. password autofill functionality should be disabled).' required: false type: boolean default: false @@ -51,8 +51,13 @@ on: required: false type: string default: '' + swiftVersion: + description: 'Specify the Swift language version when using xcodebuild.' + required: false + type: string + default: '' test: - description: 'A flag indicating if the tests of the Xcode project scheme should run' + description: 'A flag indicating if the tests of the Xcode project scheme should run when using xcodebuild.' required: false type: boolean default: true @@ -366,6 +371,12 @@ jobs: else ENABLE_TESTING_FLAG="" fi + + if [ -n "${{ inputs.swiftVersion }}" ]; then + SWIFT_VERSION_FLAG="-swift-version ${{ inputs.swiftVersion }}" + else + SWIFT_VERSION_FLAG="" + fi set -o pipefail \ && xcodebuild $XCODECOMMAND \ @@ -377,7 +388,7 @@ jobs: -resultBundlePath "$RESULTBUNDLE" \ CODE_SIGNING_REQUIRED=NO \ CODE_SIGN_IDENTITY="" \ - OTHER_SWIFT_FLAGS="\$(inherited) $ENABLE_TESTING_FLAG" \ + OTHER_SWIFT_FLAGS="\$(inherited) $ENABLE_TESTING_FLAG $SWIFT_VERSION_FLAG" \ -skipPackagePluginValidation \ -skipMacroValidation \ | xcbeautify