mirror of
https://github.com/VSCodium/vscodium.git
synced 2024-12-23 08:52:43 +03:00
ci: correctly check assets [skip ci]
This commit is contained in:
parent
a1f3d6ff6c
commit
07b7cb95cf
@ -9,10 +9,15 @@ if [[ -z "${GITHUB_TOKEN}" ]]; then
|
||||
fi
|
||||
|
||||
APP_NAME_LC="$( echo "${APP_NAME}" | awk '{print tolower($0)}' )"
|
||||
GITHUB_RESPONSE=$( curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${ASSETS_REPOSITORY}/releases/latest" )
|
||||
LATEST_VERSION=$( echo "${GITHUB_RESPONSE}" | jq -c -r '.tag_name' )
|
||||
|
||||
if [[ "${LATEST_VERSION}" =~ ^([0-9]+\.[0-9]+\.[0-9]+) ]]; then
|
||||
if [[ "${SHOULD_DEPLOY}" == "no" ]]; then
|
||||
ASSETS="null"
|
||||
else
|
||||
GITHUB_RESPONSE=$( curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${ASSETS_REPOSITORY}/releases/latest" )
|
||||
LATEST_VERSION=$( echo "${GITHUB_RESPONSE}" | jq -c -r '.tag_name' )
|
||||
RECHECK_ASSETS="${SHOULD_BUILD}"
|
||||
|
||||
if [[ "${LATEST_VERSION}" =~ ^([0-9]+\.[0-9]+\.[0-9]+) ]]; then
|
||||
if [[ "${MS_TAG}" != "${BASH_REMATCH[1]}" ]]; then
|
||||
echo "New VSCode version, new build"
|
||||
export SHOULD_BUILD="yes"
|
||||
@ -36,10 +41,16 @@ if [[ "${LATEST_VERSION}" =~ ^([0-9]+\.[0-9]+\.[0-9]+) ]]; then
|
||||
|
||||
echo "Switch to release version: ${RELEASE_VERSION}"
|
||||
|
||||
ASSETS=$( echo "${GITHUB_RESPONSE}" | jq -c '.assets | map(.name)?' )
|
||||
elif [[ "${RECHECK_ASSETS}" == "yes" ]]; then
|
||||
ASSETS=$( echo "${GITHUB_RESPONSE}" | jq -c '.assets | map(.name)?' )
|
||||
else
|
||||
ASSETS="null"
|
||||
fi
|
||||
else
|
||||
echo "can't check assets"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
contains() {
|
||||
@ -47,6 +58,7 @@ contains() {
|
||||
echo "${ASSETS}" | grep "${1}\""
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2153
|
||||
if [[ "${CHECK_ASSETS}" == "no" ]]; then
|
||||
echo "Don't check assets, yet"
|
||||
elif [[ "${ASSETS}" != "null" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user