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

Support for self-hosted enterprise url #170

Merged
merged 7 commits into from
Oct 7, 2024
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
16 changes: 10 additions & 6 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,27 +179,31 @@ fi
MD5_SUM=$(md5sum ${RELEASE_ASSET_PATH} | cut -d ' ' -f 1)
SHA256_SUM=$(sha256sum ${RELEASE_ASSET_PATH} | cut -d ' ' -f 1)

# prefix upload extra params
GITHUB_ASSETS_UPLOADR_EXTRA_OPTIONS=''
# uploader command
BASE_UPLOADER_COMMAND="github-assets-uploader -logtostderr -repo ${RELEASE_REPO} -token ${INPUT_GITHUB_TOKEN} -tag=${RELEASE_TAG} -releasename=${RELEASE_NAME} -retry ${INPUT_RETRY}"
if [ ${GITHUB_SERVER_URL} != 'https://github.com' ]; then
BASE_UPLOADER_COMMAND="${BASE_UPLOADER_COMMAND} -baseurl ${GITHUB_SERVER_URL}"
fi
if [ ${INPUT_OVERWRITE^^} == 'TRUE' ]; then
GITHUB_ASSETS_UPLOADR_EXTRA_OPTIONS="-overwrite"
BASE_UPLOADER_COMMAND="${BASE_UPLOADER_COMMAND} -overwrite"
fi


if [ ${INPUT_UPLOAD^^} == 'TRUE' ]; then
# update binary and checksum
github-assets-uploader -logtostderr -f ${RELEASE_ASSET_PATH} -mediatype ${MEDIA_TYPE} ${GITHUB_ASSETS_UPLOADR_EXTRA_OPTIONS} -repo ${RELEASE_REPO} -token ${INPUT_GITHUB_TOKEN} -tag=${RELEASE_TAG} -releasename=${RELEASE_NAME} -retry ${INPUT_RETRY}
${BASE_UPLOADER_COMMAND} -f ${RELEASE_ASSET_PATH} -mediatype ${MEDIA_TYPE}
if [ ${INPUT_MD5SUM^^} == 'TRUE' ]; then
MD5_EXT='.md5'
MD5_MEDIA_TYPE='text/plain'
echo ${MD5_SUM} >${RELEASE_ASSET_PATH}${MD5_EXT}
github-assets-uploader -logtostderr -f ${RELEASE_ASSET_PATH}${MD5_EXT} -mediatype ${MD5_MEDIA_TYPE} ${GITHUB_ASSETS_UPLOADR_EXTRA_OPTIONS} -repo ${RELEASE_REPO} -token ${INPUT_GITHUB_TOKEN} -tag=${RELEASE_TAG} -releasename=${RELEASE_NAME} -retry ${INPUT_RETRY}
${BASE_UPLOADER_COMMAND} -f ${RELEASE_ASSET_PATH}${MD5_EXT} -mediatype ${MD5_MEDIA_TYPE}
fi

if [ ${INPUT_SHA256SUM^^} == 'TRUE' ]; then
SHA256_EXT='.sha256'
SHA256_MEDIA_TYPE='text/plain'
echo ${SHA256_SUM} >${RELEASE_ASSET_PATH}${SHA256_EXT}
github-assets-uploader -logtostderr -f ${RELEASE_ASSET_PATH}${SHA256_EXT} -mediatype ${SHA256_MEDIA_TYPE} ${GITHUB_ASSETS_UPLOADR_EXTRA_OPTIONS} -repo ${RELEASE_REPO} -token ${INPUT_GITHUB_TOKEN} -tag=${RELEASE_TAG} -releasename=${RELEASE_NAME} -retry ${INPUT_RETRY}
${BASE_UPLOADER_COMMAND} -f ${RELEASE_ASSET_PATH}${SHA256_EXT} -mediatype ${SHA256_MEDIA_TYPE}
fi
fi

Expand Down