Update artifact bundle script to include Linux

This commit is contained in:
Nick Lockwood
2023-02-25 00:34:42 +00:00
parent 855da39eba
commit 2ebd36126b
2 changed files with 14 additions and 5 deletions
@@ -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"]
}
]
}
+10 -5
View File
@@ -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"