diff options
author | Lukas Larsson <lukas@erlang.org> | 2020-11-17 16:56:05 +0100 |
---|---|---|
committer | Lukas Larsson <lukas@erlang.org> | 2020-11-17 17:02:56 +0100 |
commit | 09d422907c7f8c248545095b09c5771024cfb7b7 (patch) | |
tree | 0f1fa581ea7d02ac7d289787b127ce1854d74135 /.github/scripts | |
parent | 4f278dca155ab567ba7d1f4d459bff9b03928f37 (diff) | |
download | erlang-09d422907c7f8c248545095b09c5771024cfb7b7.tar.gz |
Fix sync of readme
Diffstat (limited to '.github/scripts')
-rwxr-xr-x | .github/scripts/sync-github-releases.sh | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/.github/scripts/sync-github-releases.sh b/.github/scripts/sync-github-releases.sh index 7a3bbe00e9..169248582d 100755 --- a/.github/scripts/sync-github-releases.sh +++ b/.github/scripts/sync-github-releases.sh @@ -20,7 +20,7 @@ set -e REPOSITORY=${1} -TOKEN=${2} +TOKEN=${2:-"token ${GITHUB_TOKEN}"} RELEASE_FILTER=${3} TIME_LIMIT=${4:-120m} HDR=(-H "Authorization: ${TOKEN}") @@ -82,20 +82,31 @@ while [ "${TAG_URL}" != "" ]; do echo "Create release ${name}" else _asset() { - local filename=${1} - local remotename=${2:-${filename}} + local filename="${1}" + local remotename=("${2:-$filename}") + if [ $# -gt 2 ]; then + shift; shift + remotename=("$@" "${remotename[@]}") + fi if ! echo "${RELEASE}" | jq -er ".assets[] | select(.name == \"${filename}\")" > /dev/null; then ALL_TAGS=("${ALL_TAGS[@]}" "${name}") - echo "Sync ${remotename} for ${name}" - RI=("${remotename}" "${RI[@]}") + echo "Sync ${remotename[*]} for ${name}" + RI=("${remotename[@]}" "${RI[@]}") fi } - _asset "${name}.README" "${name}.README otp_src_${stripped_name}.readme" - _asset "otp_src_${stripped_name}.tar.gz" "" - _asset "otp_doc_html_${stripped_name}.tar.gz" "" - _asset "otp_doc_man_${stripped_name}.tar.gz" "" - _asset "otp_win32_${stripped_name}.exe" "" - _asset "otp_win64_${stripped_name}.exe" "" + _asset "${name}.README" "${name}.README" "otp_src_${stripped_name}.readme" + _asset "otp_src_${stripped_name}.tar.gz" + _asset "otp_doc_html_${stripped_name}.tar.gz" + _asset "otp_doc_man_${stripped_name}.tar.gz" + case "${stripped_name}" in + 22.*.**|21.*.**) + ## No need to check for windows releases in 21 and 22 patches + ;; + *) + _asset "otp_win32_${stripped_name}.exe" + _asset "otp_win64_${stripped_name}.exe" + ;; + esac fi fi done |