feat: insider version (#1217)

This commit is contained in:
Baptiste Augrain
2022-08-29 15:13:25 +02:00
committed by GitHub
parent 58707d73ba
commit 61e880da67
194 changed files with 5378 additions and 212 deletions

View File

@@ -8,10 +8,29 @@ if [[ "${CI_BUILD}" != "no" ]]; then
fi
if [[ -z "${RELEASE_VERSION}" ]]; then
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/stable/lol)
export MS_TAG=$(echo "${UPDATE_INFO}" | jq -r '.name')
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
if [[ "${VSCODE_LATEST}" == "yes" ]] || [[ ! -f "insider.json" ]]; then
UPDATE_INFO=$( curl https://update.code.visualstudio.com/api/update/darwin/insider/lol )
else
export MS_COMMIT=$(jq -r '.commit' insider.json)
export MS_TAG=$(jq -r '.tag' insider.json)
fi
else
UPDATE_INFO=$( curl https://update.code.visualstudio.com/api/update/darwin/stable/lol )
fi
if [[ -z "${MS_COMMIT}" ]]; then
export MS_COMMIT=$( echo "${UPDATE_INFO}" | jq -r '.version' )
export MS_TAG=$( echo "${UPDATE_INFO}" | jq -r '.name' )
fi
date=$( date +%Y%j )
export RELEASE_VERSION="${MS_TAG}.${date: -5}"
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
export RELEASE_VERSION="${MS_TAG/\-insider/}.${date: -5}-insider"
else
export RELEASE_VERSION="${MS_TAG}.${date: -5}"
fi
else
if [[ "${RELEASE_VERSION}" =~ ^([0-9]+\.[0-9]+\.[0-9]+)\.[0-9]+$ ]];
then
@@ -31,15 +50,15 @@ git init -q
git remote add origin https://github.com/Microsoft/vscode.git
# figure out latest tag by calling MS update API
if [ "${INSIDER}" == "1" ]; then
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/insider/lol)
export MS_COMMIT=$(echo "${UPDATE_INFO}" | jq -r '.version')
export MS_TAG=$(echo "${UPDATE_INFO}" | jq -r '.name')
elif [[ -z "${MS_TAG}" ]]; then
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/stable/lol)
export MS_COMMIT=$(echo "${UPDATE_INFO}" | jq -r '.version')
export MS_TAG=$(echo "${UPDATE_INFO}" | jq -r '.name')
else
if [[ -z "${MS_TAG}" ]]; then
if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
UPDATE_INFO=$( curl https://update.code.visualstudio.com/api/update/darwin/insider/lol )
else
UPDATE_INFO=$( curl https://update.code.visualstudio.com/api/update/darwin/stable/lol )
fi
export MS_COMMIT=$( echo "${UPDATE_INFO}" | jq -r '.version' )
export MS_TAG=$( echo "${UPDATE_INFO}" | jq -r '.name' )
elif [[ -z "${MS_COMMIT}" ]]; then
reference=$( git ls-remote --tags | grep -x ".*refs\/tags\/${MS_TAG}" | head -1 )
if [[ -z "${reference}" ]]; then