Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Add file extension to windows binaries #1969

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions scripts/provider_bundler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand All @@ -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
Expand Down