vscodium/stores/winget/check_version.sh

26 lines
728 B
Bash
Raw Normal View History

2022-09-19 01:27:12 -04:00
#!/bin/bash
set -e
2022-10-06 16:15:41 -04:00
VERSIONS=$( curl --silent "https://api.github.com/repos/microsoft/winget-pkgs/contents/manifests/v/${APP_IDENTIFIER//.//}" )
2022-09-19 01:27:12 -04:00
2022-10-06 16:15:41 -04:00
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
2022-09-19 01:27:12 -04:00
RELEASE_VERSION="${RELEASE_VERSION/\-insider/}"
fi
WINGET_VERSION=$( echo "${VERSIONS}" | jq -r 'map(select(.name | startswith("1."))) | map(.name) | last' )
2022-09-19 01:27:12 -04:00
echo "RELEASE_VERSION=\"${RELEASE_VERSION}\""
echo "WINGET_VERSION=\"${WINGET_VERSION}\""
if [[ "${RELEASE_VERSION}" == "${WINGET_VERSION}" ]]; then
export SHOULD_DEPLOY="no"
else
export SHOULD_DEPLOY="yes"
fi
if [[ "${GITHUB_ENV}" ]]; then
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "${GITHUB_ENV}"
echo "SHOULD_DEPLOY=${SHOULD_DEPLOY}" >> "${GITHUB_ENV}"
fi