Skip to content

Commit

Permalink
use zip for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
azilber committed Apr 4, 2020
1 parent d286651 commit 74fd21a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,23 @@ FILE_LIST="${FILE_LIST} ${EXTRA_FILES}"

FILE_LIST=`echo "${FILE_LIST}" | awk '{$1=$1};1'`

tar cvfz tmp.tgz ${FILE_LIST}
CHECKSUM=$(md5sum tmp.tgz | cut -d ' ' -f 1)

if [ $GOOS == 'windows' ]; then
ARCHIVE=tmp.zip
zip -9r $ARCHIVE ${FILE_LIST}
else
ARCHIVE=tmp.tgz
tar cvfz $ARCHIVE ${FILE_LIST}
fi

CHECKSUM=$(md5sum ${ARCHIVE} | cut -d ' ' -f 1)

curl \
-X POST \
--data-binary @tmp.tgz \
-H 'Content-Type: application/gzip' \
--data-binary @${ARCHIVE} \
-H 'Content-Type: application/octet-stream' \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
"${UPLOAD_URL}?name=${NAME}.tar.gz"
"${UPLOAD_URL}?name=${NAME}.${ARCHIVE/tmp./}"

curl \
-X POST \
Expand Down

0 comments on commit 74fd21a

Please sign in to comment.