From e364f07989916ffb9f50d7ef6c0a8c48082c2792 Mon Sep 17 00:00:00 2001 From: Yegor Bayev Date: Thu, 28 Nov 2024 23:33:42 +0300 Subject: [PATCH] fix(install): choose file extension based upon running OS (#41) Co-authored-by: Yegor Bayev <233409+kodx@users.noreply.github.com> --- install.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 5bd464a..bfeebf3 100755 --- a/install.sh +++ b/install.sh @@ -6,10 +6,19 @@ fi set -uo pipefail +ARCHIVE_EXT='.tar.gz' + case "${RUNNER_OS}" in - macOS) OS=apple-darwin ;; - Windows) OS=pc-windows-msvc ;; - *) OS=unknown-linux-gnu ;; + macOS) + OS=apple-darwin + ;; + Windows) + OS=pc-windows-msvc + ARCHIVE_EXT='.zip' + ;; + *) + OS=unknown-linux-gnu + ;; esac case "${RUNNER_ARCH}" in ARM64) ARCH=aarch64 ;; @@ -40,7 +49,7 @@ else fi TAG_NAME="$(echo "${RELEASE_INFO}" | jq --raw-output ".tag_name")" -TARGET="git-cliff-${TAG_NAME:1}-${ARCH}-${OS}.tar.gz" +TARGET="git-cliff-${TAG_NAME:1}-${ARCH}-${OS}${ARCHIVE_EXT}" LOCATION="$(echo "${RELEASE_INFO}" | jq --raw-output ".assets[].browser_download_url" | grep "${TARGET}$")"