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"