2021-03-11 13:44:02 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
set -eou pipefail
|
|
|
|
|
|
|
|
RELEASE_TAG=$1
|
|
|
|
OUTPUT_DIR=$2
|
|
|
|
|
|
|
|
mkdir -p $OUTPUT_DIR/github
|
|
|
|
INSTALLER=daml-sdk-$RELEASE_TAG-windows.exe
|
2021-03-11 16:49:48 +03:00
|
|
|
EE_INSTALLER=daml-sdk-$RELEASE_TAG-windows-ee.exe
|
|
|
|
mv "bazel-bin/release/windows-installer/daml-sdk-installer-ce.exe" "$OUTPUT_DIR/github/$INSTALLER"
|
|
|
|
mv "bazel-bin/release/windows-installer/daml-sdk-installer-ee.exe" "$OUTPUT_DIR/artifactory/$EE_INSTALLER"
|
2021-03-11 13:44:02 +03:00
|
|
|
chmod +wx "$OUTPUT_DIR/github/$INSTALLER"
|
2021-03-11 16:49:48 +03:00
|
|
|
chmod +wx "$OUTPUT_DIR/artifactory/$EE_INSTALLER"
|
2021-03-11 13:44:02 +03:00
|
|
|
cleanup () {
|
|
|
|
rm -f signing_key.pfx
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
echo "$SIGNING_KEY" | base64 -d > signing_key.pfx
|
2021-03-11 16:49:48 +03:00
|
|
|
for path in "$OUTPUT_DIR/github/$INSTALLER" "$OUTPUT_DIR/artifactory/$EE_INSTALLER"; do
|
|
|
|
MSYS_NO_PATHCONV=1 signtool.exe sign '/f' signing_key.pfx '/fd' sha256 '/tr' "http://timestamp.digicert.com" '/v' "$path"
|
|
|
|
done
|
2021-03-11 13:44:02 +03:00
|
|
|
rm signing_key.pfx
|
|
|
|
trap - EXIT
|
|
|
|
TARBALL=daml-sdk-$RELEASE_TAG-windows.tar.gz
|
2021-03-11 16:49:48 +03:00
|
|
|
EE_TARBALL=daml-sdk-$RELEASE_TAG-windows-ee.tar.gz
|
|
|
|
cp bazel-bin/release/sdk-release-tarball-ce.tar.gz "$OUTPUT_DIR/github/$TARBALL"
|
|
|
|
cp bazel-bin/release/sdk-release-tarball-ee.tar.gz "$OUTPUT_DIR/artifactory/$EE_TARBALL"
|