Skip to content

Commit

Permalink
Add build configuration parameter to enable Debug or Release buil…
Browse files Browse the repository at this point in the history
…ds (#45)

# Add build configuration parameter to enable `Debug` or `Release`
builds

## ♻️ Current situation & Problem
As of now, there is no option to adjust the build configuration of the
`xcodebuild-or-fastlane.yml` GitHub Action.
This functionality would be very useful, especially for important
production builds or repos that rely on low-layer Swift functionality.


## ⚙️ Release Notes 
- Add build configuration parameter to `xcodebuild-or-fastlane.yml` to
enable `Debug` or `Release` builds


## 📚 Documentation
Proper documentation of parameter


## ✅ Testing
Tested with the `SpeziLLM` action:
https://github.com/StanfordSpezi/SpeziLLM/actions/runs/7607351909


## 📝 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
philippzagar authored Jan 22, 2024
1 parent 8d54482 commit 3278fcc
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/xcodebuild-or-fastlane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ on:
required: false
type: string
default: ''
buildConfig:
description: 'The build configuration parameter that should be passed to xcodebuild. Either use `Debug` or `Release` to build in the respective modes. If not defined, the `Debug` configuration is used.'
required: false
type: string
default: 'Debug'
destination:
description: 'The destination parameter that should be passed to xcodebuild. Defaults to the iOS simulator using an iPhone 15 Pro'
required: false
Expand Down Expand Up @@ -340,14 +345,22 @@ jobs:
RESULTBUNDLE=${{ inputs.resultBundle }}
fi
if [ "${{ inputs.buildConfig }}" = "Release" ]; then
ENABLE_TESTING_FLAG="-enable-testing"
else
ENABLE_TESTING_FLAG=""
fi
set -o pipefail \
&& xcodebuild $XCODECOMMAND \
-scheme "${{ inputs.scheme }}" \
-configuration "${{ inputs.buildConfig }}" \
-destination "${{ inputs.destination }}" \
$CODECOVERAGEFLAG \
-derivedDataPath ".derivedData" \
-resultBundlePath "$RESULTBUNDLE" \
CODE_SIGNING_REQUIRED=NO \
OTHER_SWIFT_FLAGS="\$(inherited) $ENABLE_TESTING_FLAG" \
| xcpretty
- name: Fastlane
if: ${{ inputs.fastlanelane != '' }}
Expand All @@ -361,7 +374,7 @@ jobs:
if: ${{ !env.selfhosted && inputs.codeql }}
uses: github/codeql-action/analyze@v2
- name: Upload artifact
if: ${{ (success() || failure()) && inputs.artifactname != '' }}
if: ${{ (success() || failure()) && inputs.artifactname != '' && inputs.buildConfig != 'Release' }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifactname }}
Expand Down

0 comments on commit 3278fcc

Please sign in to comment.