From 2ebd36126bd2e87ee88eb47799ca1f3d69b01766 Mon Sep 17 00:00:00 2001 From: Nick Lockwood Date: Sat, 25 Feb 2023 00:34:42 +0000 Subject: [PATCH] Update artifact bundle script to include Linux --- ...template => spm-artifact-bundle-info.template} | 4 ++++ Scripts/spm-artifact-bundle.sh | 15 ++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) rename Scripts/{spm-macos-artifact-bundle-info.template => spm-artifact-bundle-info.template} (67%) diff --git a/Scripts/spm-macos-artifact-bundle-info.template b/Scripts/spm-artifact-bundle-info.template similarity index 67% rename from Scripts/spm-macos-artifact-bundle-info.template rename to Scripts/spm-artifact-bundle-info.template index 4ac9c2d7..c5807f93 100644 --- a/Scripts/spm-macos-artifact-bundle-info.template +++ b/Scripts/spm-artifact-bundle-info.template @@ -8,6 +8,10 @@ { "path": "swiftformat-__VERSION__-macos/bin/swiftformat", "supportedTriples": ["x86_64-apple-macosx", "arm64-apple-macosx"] + }, + { + "path": "swiftformat-__VERSION__-linux-gnu/bin/swiftformat_linux", + "supportedTriples": ["x86_64-unknown-linux-gnu"] } ] } diff --git a/Scripts/spm-artifact-bundle.sh b/Scripts/spm-artifact-bundle.sh index f9615b36..76a919bc 100755 --- a/Scripts/spm-artifact-bundle.sh +++ b/Scripts/spm-artifact-bundle.sh @@ -3,9 +3,10 @@ set -e ARTIFACT_BUNDLE=swiftformat.artifactbundle -INFO_TEMPLATE=Scripts/spm-macos-artifact-bundle-info.template +INFO_TEMPLATE=Scripts/spm-artifact-bundle-info.template VERSION=$(./Scripts/get-version.sh) -BINARY_OUTPUT_DIR=$ARTIFACT_BUNDLE/swiftformat-$VERSION-macos/bin +MAC_BINARY_OUTPUT_DIR=$ARTIFACT_BUNDLE/swiftformat-$VERSION-macos/bin +LINUX_BINARY_OUTPUT_DIR=$ARTIFACT_BUNDLE/swiftformat-$VERSION-linux-gnu/bin mkdir $ARTIFACT_BUNDLE @@ -15,9 +16,13 @@ cp LICENSE.md $ARTIFACT_BUNDLE # Create bundle info.json from template, replacing version sed 's/__VERSION__/'"${VERSION}"'/g' $INFO_TEMPLATE > "${ARTIFACT_BUNDLE}/info.json" -# Copy MacOS SwiftFormat binary into bundle -mkdir -p $BINARY_OUTPUT_DIR -cp CommandLineTool/swiftformat $BINARY_OUTPUT_DIR +# Copy macOS SwiftFormat binary into bundle +mkdir -p $MAC_BINARY_OUTPUT_DIR +cp CommandLineTool/swiftformat $MAC_BINARY_OUTPUT_DIR + +# Copy Linux SwiftFormat binary into bundle +mkdir -p $LINUX_BINARY_OUTPUT_DIR +cp CommandLineTool/swiftformat_linux $LINUX_BINARY_OUTPUT_DIR # Create ZIP zip -yr - $ARTIFACT_BUNDLE > "${ARTIFACT_BUNDLE}.zip"