From 45551049d86890e28614bd8d39b034b8433c9e6d Mon Sep 17 00:00:00 2001 From: Christian Zunker <827818+czunker@users.noreply.github.com> Date: Thu, 28 Sep 2023 10:29:30 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Add=20file=20extension=20to=20wi?= =?UTF-8?q?ndows=20binaries=20(#1969)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1949 Signed-off-by: Christian Zunker --- scripts/provider_bundler.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/provider_bundler.sh b/scripts/provider_bundler.sh index e15dfa84f4..9a76df3e97 100755 --- a/scripts/provider_bundler.sh +++ b/scripts/provider_bundler.sh @@ -59,7 +59,11 @@ build_bundle(){ echo "Building ${PROVIDER_DIST}/${PROVIDER_NAME} for ${GOOS}/${GOARCH}/${GOARM} ..." # we switch into the path to use the local go.mods - cd ${PROVIDER_PATH} && CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -tags production -ldflags "-s -w" -o ${PROVIDER_DIST}/${PROVIDER_NAME} main.go + PROVIDER_EXECUTABLE="${PROVIDER_NAME}" + if [[ "${GOOS}" == "windows" ]]; then + PROVIDER_EXECUTABLE="${PROVIDER_EXECUTABLE}.exe" + fi + cd ${PROVIDER_PATH} && CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -tags production -ldflags "-s -w" -o ${PROVIDER_DIST}/${PROVIDER_EXECUTABLE} main.go # set linux flags that do not work on macos TAR_FLAGS="" @@ -70,14 +74,14 @@ build_bundle(){ tar -cf ${BUNDLE_DIST}/${PROVIDER_NAME}_${PROVIDER_VERSION}_${GOOS}_${GOARCH}.tar.xz \ ${TAR_FLAGS} --use-compress-program='xz -9v' \ -C ${PROVIDER_DIST} \ - ${PROVIDER_NAME} ${PROVIDER_NAME}.json ${PROVIDER_NAME}.resources.json + ${PROVIDER_EXECUTABLE} ${PROVIDER_NAME}.json ${PROVIDER_NAME}.resources.json if [ $? -ne 0 ]; then echo "Failed to build the ${PROVIDER_NAME} provider." exit 1 fi - rm ${PROVIDER_DIST}/${PROVIDER_NAME} + rm ${PROVIDER_DIST}/${PROVIDER_EXECUTABLE} } # Build Darwin Architectures