From 7f27851336a1de245b52417af324823000775712 Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Tue, 5 Dec 2023 10:45:09 -0500 Subject: [PATCH 1/2] feat: add new package-windows script --- tools/package-windows-x64.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 tools/package-windows-x64.sh diff --git a/tools/package-windows-x64.sh b/tools/package-windows-x64.sh new file mode 100755 index 000000000..ce9d4d2c0 --- /dev/null +++ b/tools/package-windows-x64.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# This script is used to package the macOS x64 binaries for sshnoports. +# It first unpacks the prebuilt binaries, then it calls the notarize-macos.sh +# script to notarize the binaries + +FULL_PATH_TO_SCRIPT="$(realpath "${BASH_SOURCE[0]}")" +SCRIPT_DIRECTORY="$(dirname "$FULL_PATH_TO_SCRIPT")" +ROOT_DIRECTORY="$SCRIPT_DIRECTORY/.." + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +if [ "$(uname)" != "Darwin" ]; then + echo "This script is only for macOS"; + exit 1; +fi + +TAR_FILE="$1" + +OUTPUT_DIR_PATH="$ROOT_DIRECTORY/build/windows-x64" +OUTPUT_DIR="$OUTPUT_DIR_PATH/sshnp" + +rm -r "$OUTPUT_DIR_PATH" +mkdir -p "$OUTPUT_DIR" +tar -xvf "$TAR_FILE" -C "$OUTPUT_DIR_PATH" + +# Zip the signed binaries +ditto -c -k --keepParent "$OUTPUT_DIR_PATH"/sshnp "$OUTPUT_DIR_PATH/sshnp-windows-x64".zip \ No newline at end of file From d2401e02732044f205f1249b5cbb51c1ec1d807c Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Tue, 5 Dec 2023 11:28:27 -0500 Subject: [PATCH 2/2] docs: update packaging script comments --- tools/package-macos-x64.sh | 2 ++ tools/package-windows-x64.sh | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/package-macos-x64.sh b/tools/package-macos-x64.sh index 0a369104c..2491f1241 100755 --- a/tools/package-macos-x64.sh +++ b/tools/package-macos-x64.sh @@ -4,6 +4,8 @@ # It first unpacks the prebuilt binaries, then it calls the notarize-macos.sh # script to notarize the binaries +# This script expects the path to the tgz archive as an argument + FULL_PATH_TO_SCRIPT="$(realpath "${BASH_SOURCE[0]}")" SCRIPT_DIRECTORY="$(dirname "$FULL_PATH_TO_SCRIPT")" ROOT_DIRECTORY="$SCRIPT_DIRECTORY/.." diff --git a/tools/package-windows-x64.sh b/tools/package-windows-x64.sh index ce9d4d2c0..7d4ed756e 100755 --- a/tools/package-windows-x64.sh +++ b/tools/package-windows-x64.sh @@ -1,8 +1,11 @@ #!/bin/bash -# This script is used to package the macOS x64 binaries for sshnoports. -# It first unpacks the prebuilt binaries, then it calls the notarize-macos.sh -# script to notarize the binaries +# This script is used to package the windows x64 binaries for sshnoports. +# It first unpacks the tgz archive of binaries, then it repacks them as a .zip +# This script requires that you do this packaging on a mac, since it is expected +# that you do it while notarizing the macos binaries to save time + +# This script expects the path to the tgz archive as an argument FULL_PATH_TO_SCRIPT="$(realpath "${BASH_SOURCE[0]}")" SCRIPT_DIRECTORY="$(dirname "$FULL_PATH_TO_SCRIPT")"