mirror of
https://github.com/nicklockwood/SwiftFormat.git
synced 2026-05-17 10:30:35 +00:00
74a534976f
* Add AArch64 variant to Artifact Bundle * Use Docker to build executable * Update x64 Linux build * Share build dependencies between architectures
28 lines
520 B
Bash
Executable File
28 lines
520 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eo pipefail
|
|
|
|
pushd "$(dirname "${BASH_SOURCE[0]}")/.." > /dev/null
|
|
|
|
BUILD_ARGS=(
|
|
--product swiftformat
|
|
--configuration release
|
|
-Xlinker -S
|
|
)
|
|
|
|
if [[ -z "$TARGETPLATFORM" ]]; then
|
|
ARCH="$(uname -m)"
|
|
else
|
|
if [[ "$TARGETPLATFORM" = "linux/amd64" ]]; then
|
|
ARCH="x86_64"
|
|
elif [[ "$TARGETPLATFORM" = "linux/arm64" ]]; then
|
|
ARCH="aarch64"
|
|
else
|
|
echo "Unsupported target platform: $TARGETPLATFORM"
|
|
exit 1
|
|
fi
|
|
fi
|
|
BUILD_ARGS+=(--swift-sdk "${ARCH}-swift-linux-musl")
|
|
|
|
swift build "${BUILD_ARGS[@]}"
|