From b6d2aabf4a7388ce9d1a6585e4e0950ce96e07ac Mon Sep 17 00:00:00 2001 From: JSON Date: Thu, 25 May 2023 14:08:17 +0100 Subject: [PATCH] fix: publish to latest in S3 (#4619) --- release-scripts/upload-artifacts.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/release-scripts/upload-artifacts.sh b/release-scripts/upload-artifacts.sh index 51f1a13b7a..af284e26b4 100755 --- a/release-scripts/upload-artifacts.sh +++ b/release-scripts/upload-artifacts.sh @@ -92,27 +92,28 @@ upload_npm() { } upload_s3() { + version_target=$1 if [ "${DRY_RUN}" == true ]; then echo "DRY RUN: uploading to S3..." for filename in "${StaticFiles[@]}"; do - aws s3 cp "${filename}" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/ --dryrun + aws s3 cp "${filename}" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/ --dryrun done - aws s3 cp "binary-releases/release.json" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/ --dryrun - aws s3 cp "binary-releases/version" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/ --dryrun + aws s3 cp "binary-releases/release.json" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/ --dryrun + aws s3 cp "binary-releases/version" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/ --dryrun else echo "Uploading to S3..." for filename in "${StaticFiles[@]}"; do - aws s3 cp "${filename}" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/ + aws s3 cp "${filename}" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/ done - aws s3 cp "binary-releases/release.json" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/ - aws s3 cp "binary-releases/version" s3://"${PUBLIC_S3_BUCKET}"/cli/"${VERSION_TAG}"/ + aws s3 cp "binary-releases/release.json" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/ + aws s3 cp "binary-releases/version" s3://"${PUBLIC_S3_BUCKET}"/cli/"${version_target}"/ fi } # Capture valid flags -while getopts ":h:t:-:" opt; do +while getopts ":h:-:" opt; do case ${opt} in h) show_help @@ -160,6 +161,6 @@ for arg in "${@}"; do # Upload files to S3 bucket else - upload_s3 + upload_s3 "${target}" fi done