Skip to content

Commit

Permalink
Allow to specify Swift version with xcodebuild (#57)
Browse files Browse the repository at this point in the history
# Allow to specify Swift version with xcodebuild

## ♻️ Current situation & Problem
This PR adds a new input to specify the swift version when running with
xcodebuild.


## ⚙️ Release Notes 
* Add new `swiftVersion` input to the xcodebuild-or-fastlane action.
* Specify more clearly that the `test` input only has an effect when
using xcodebuild.


## 📚 Documentation
--


## ✅ Testing
Verified in StanfordSpezi/Spezi#108 (both with
not specifying swift version and with specifying a swift version).


## 📝 Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
Supereg authored Jul 11, 2024
1 parent 6ff45ea commit 7071f7a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/xcodebuild-or-fastlane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit 7071f7a

Please sign in to comment.