specify system setup name properly in check_tags

This commit is contained in:
Peter Squicciarini 2021-01-13 09:57:49 -08:00
parent 9dd4e545c0
commit 384789005b
2 changed files with 3 additions and 41 deletions

View file

@ -1,38 +0,0 @@
echo "tag: $env:LATEST_MS_TAG"
$REPO_URI = [uri]$env:BUILD_REPOSITORY_URI
$USER_REPO = $REPO_URI."LocalPath"
echo $USER_REPO
$GITHUB_RESPONSE = curl.exe -s -H "Authorization: token $env:MAPPED_GITHUB_TOKEN" "https://api.github.com/repos$USER_REPO/releases/tags/$env:LATEST_MS_TAG"
echo "Github response: ${GITHUB_RESPONSE}"
$VSCODIUM_ASSETS = $GITHUB_RESPONSE | jq '.assets'
echo "VSCodium assets: ${VSCODIUM_ASSETS}"
# if we just don't have the github token, get out fast
if (!$env:MAPPED_GITHUB_TOKEN -or $env:MAPPED_GITHUB_TOKEN -like "*GITHUB_TOKEN*") {
echo "This build does not have the GH token"
echo $env:MAPPED_GITHUB_TOKEN
return
}
if ($VSCODIUM_ASSETS -eq "null" -or !$VSCODIUM_ASSETS) {
echo "Release assets do not exist at all, continuing build"
$SHOULD_BUILD = 'yes'
} else {
$WindowsAssets = ($VSCODIUM_ASSETS | ConvertFrom-Json) | Where-Object { $_.name.Contains('exe') }
$SYSTEM_SETUP = $WindowsAssets | Where-Object { $_.name.Contains('Setup') }
$USER_SETUP = $WindowsAssets | Where-Object { $_.name.Contains('User') }
if (!$SYSTEM_SETUP) {
echo "Building on Windows because we have no system-setup.exe";
$SHOULD_BUILD = 'yes'
}
elseif (!$USER_SETUP) {
echo "Building on Windows because we have no user-setup.exe";
$SHOULD_BUILD = 'yes'
}
else {
echo "Already have all the Windows builds"
}
}
Write-Host "##vso[task.setvariable variable=SHOULD_BUILD]$SHOULD_BUILD"

View file

@ -17,7 +17,7 @@ if [ "$GITHUB_TOKEN" != "" ]; then
fi
elif [[ "$OS_NAME" == "windows" ]]; then
if [[ $VSCODE_ARCH == "arm64" ]]; then
HAVE_ARM64_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_ARM64_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "VSCodiumSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_ARM64_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_ARM64_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$LATEST_MS_TAG.zip" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_ARM64_SYS" != "true" ]]; then
@ -36,7 +36,7 @@ if [ "$GITHUB_TOKEN" != "" ]; then
echo "Already have all the Windows arm64 builds"
fi
elif [[ $VSCODE_ARCH == "ia32" ]]; then
HAVE_IA32_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_IA32_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "VSCodiumSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_IA32_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_IA32_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$LATEST_MS_TAG.zip" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_IA32_SYS" != "true" ]]; then
@ -55,7 +55,7 @@ if [ "$GITHUB_TOKEN" != "" ]; then
echo "Already have all the Windows ia32 builds"
fi
else # Windows x64
HAVE_X64_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_X64_SYS=$(echo $VSCODIUM_ASSETS | jq --arg suffix "VSCodiumSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_X64_USR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "UserSetup-$VSCODE_ARCH-$LATEST_MS_TAG.exe" 'map(.name) | contains([$suffix])')
HAVE_X64_ZIP=$(echo $VSCODIUM_ASSETS | jq --arg suffix "win32-$VSCODE_ARCH-$LATEST_MS_TAG.zip" 'map(.name) | contains([$suffix])')
if [[ "$HAVE_X64_SYS" != "true" ]]; then