Skip to content

Commit 4e63fcb

Browse files
committed
Add swift-configuration input option
1 parent 8f01fc0 commit 4e63fcb

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
|-----|-----|-----|
7070
| swift-version | The version of the Swift toolchain to use | 6.0.3 |
7171
| package-path | The folder where the swift package is checked out | . |
72+
| swift-configuration | Whether to build with debug or release configuration | |
7273
| swift-build-flags | Additional flags to pass to the swift build command | |
7374
| swift-test-flags | Additional flags to pass to the swift test command | |
7475
| test-env | Test environment variables key=value | |
@@ -235,6 +236,6 @@ git tag v2.0.2
235236
git push --tags
236237
git tag -fa v2 -m "Update v2 tag"
237238
git push origin v2 --force
239+
gh release create
238240
```
239241

240-

action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ inputs:
2323
description: 'Additional flags to pass to the swift build command'
2424
required: true
2525
default: ''
26+
swift-configuration:
27+
description: 'Whether to build in debug or release configuration'
28+
required: true
29+
default: 'debug'
2630
swift-test-flags:
2731
description: 'Additional flags to pass to the swift test command'
2832
required: true
@@ -216,7 +220,7 @@ runs:
216220
if [ "${{ inputs.build-tests }}" == 'true' ]; then
217221
BUILD_TESTS="--build-tests"
218222
fi
219-
${{ steps.install.outputs.swiftcmd }} ${BUILD_TESTS}
223+
${{ steps.install.outputs.swiftcmd }} -c ${{ inputs.swift-configuration }} ${BUILD_TESTS}
220224
221225
- name: Prepare Android Emulator Test Script
222226
if: ${{ inputs.run-tests == 'true' && inputs.build-tests == 'true' && inputs.build-package == 'true' }}
@@ -237,10 +241,10 @@ runs:
237241
mkdir -p ${PACK_DIR}
238242
239243
# copy the built test binary
240-
cp -va ${BUILD_DIR}/${SWIFT_SDK_TARGET}/debug/*.xctest ${PACK_DIR}
244+
cp -va ${BUILD_DIR}/${SWIFT_SDK_TARGET}/${{ inputs.swift-configuration }}/*.xctest ${PACK_DIR}
241245
242246
# copy any optional resource bundles
243-
cp -vaf ${BUILD_DIR}/${SWIFT_SDK_TARGET}/debug/*.resources ${PACK_DIR} || true
247+
cp -vaf ${BUILD_DIR}/${SWIFT_SDK_TARGET}/${{ inputs.swift-configuration }}/*.resources ${PACK_DIR} || true
244248
# 6.0.2 keeps libraries in per-API folders
245249
cp -vaf ${SWIFT_SDK_HOME}/usr/lib/${{ steps.setup.outputs.android-sdk-arch }}-linux-android/${SWIFT_SDK_ANROID_API}/lib*.so ${PACK_DIR} || true
246250

0 commit comments

Comments
 (0)