Skip to content

Commit

Permalink
Update artifact bundle script to include Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Feb 28, 2023
1 parent 855da39 commit 2ebd361
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
]
}
Expand Down
15 changes: 10 additions & 5 deletions Scripts/spm-artifact-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
Expand Down

0 comments on commit 2ebd361

Please sign in to comment.