2018-08-13 18:24:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-09-18 23:36:03 +00:00
|
|
|
set -e
|
2020-09-18 13:01:29 +00:00
|
|
|
|
2021-09-08 23:38:07 +00:00
|
|
|
REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}"
|
|
|
|
GITHUB_RESPONSE=$( curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$REPOSITORY/releases/tags/$MS_TAG)
|
2021-09-11 22:51:25 +00:00
|
|
|
VSCODIUM_ASSETS=$( echo $GITHUB_RESPONSE | jq -c '.assets | map(.name)?' )
|
2021-09-08 23:38:07 +00:00
|
|
|
|
|
|
|
contains() {
|
|
|
|
# add " to match the end of a string so any hashs won't be matched by mistake
|
|
|
|
echo $VSCODIUM_ASSETS | grep "$1\""
|
|
|
|
}
|
2018-08-31 14:53:36 +00:00
|
|
|
|
|
|
|
# if we just don't have the github token, get out fast
|
|
|
|
if [ "$GITHUB_TOKEN" != "" ]; then
|
|
|
|
if [ "$VSCODIUM_ASSETS" != "null" ]; then
|
2021-09-08 23:38:07 +00:00
|
|
|
# macos
|
2020-09-20 21:26:06 +00:00
|
|
|
if [[ "$OS_NAME" == "osx" ]]; then
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "darwin-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then
|
2018-08-31 14:53:36 +00:00
|
|
|
echo "Building on Mac because we have no ZIP"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-01-12 20:01:29 +00:00
|
|
|
elif [[ "$OS_NAME" == "windows" ]]; then
|
2021-09-08 23:38:07 +00:00
|
|
|
# windows-arm64
|
2021-01-12 20:01:29 +00:00
|
|
|
if [[ $VSCODE_ARCH == "arm64" ]]; then
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Windows arm64 because we have no system setup"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Windows arm64 because we have no user setup"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "win32-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Windows arm64 because we have no zip"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
|
|
|
if [[ "$SHOULD_BUILD" != "yes" ]]; then
|
|
|
|
echo "Already have all the Windows arm64 builds"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
# windows-ia32
|
2021-01-12 20:01:29 +00:00
|
|
|
elif [[ $VSCODE_ARCH == "ia32" ]]; then
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Windows ia32 because we have no system setup"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Windows ia32 because we have no user setup"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "win32-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Windows ia32 because we have no zip"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-$MS_TAG.msi" ) ]]; then
|
|
|
|
echo "Building on Windows ia32 because we have no msi"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
|
|
|
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-updates-disabled-$MS_TAG.msi" ) ]]; then
|
|
|
|
echo "Building on Windows ia32 because we have no updates-disabled msi"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-01-12 20:01:29 +00:00
|
|
|
if [[ "$SHOULD_BUILD" != "yes" ]]; then
|
|
|
|
echo "Already have all the Windows ia32 builds"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
# windows-x64
|
|
|
|
else
|
|
|
|
if [[ -z $( contains "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Windows x64 because we have no system setup"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Windows x64 because we have no user setup"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "win32-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Windows x64 because we have no zip"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-$MS_TAG.msi" ) ]]; then
|
|
|
|
echo "Building on Windows x64 because we have no msi"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
|
|
|
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-updates-disabled-$MS_TAG.msi" ) ]]; then
|
|
|
|
echo "Building on Windows x64 because we have no updates-disabled msi"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-01-12 20:01:29 +00:00
|
|
|
if [[ "$SHOULD_BUILD" != "yes" ]]; then
|
|
|
|
echo "Already have all the Windows x64 builds"
|
|
|
|
fi
|
2018-08-31 14:53:36 +00:00
|
|
|
fi
|
2021-01-12 20:01:29 +00:00
|
|
|
elif [[ "$OS_NAME" == "linux" ]]; then
|
2021-09-08 23:38:07 +00:00
|
|
|
# linux-arm64
|
2021-01-12 20:01:29 +00:00
|
|
|
if [[ $VSCODE_ARCH == "arm64" ]]; then
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "arm64.deb" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Linux arm64 because we have no DEB"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-10 07:49:32 +00:00
|
|
|
if [[ -z $( contains "arm64-$MS_TAG.tar.gz" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Linux arm64 because we have no TAR"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
|
|
|
if [[ "$SHOULD_BUILD" != "yes" ]]; then
|
|
|
|
echo "Already have all the Linux arm64 builds"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
# linux-armhf
|
2021-01-12 20:01:29 +00:00
|
|
|
elif [[ $VSCODE_ARCH == "armhf" ]]; then
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "armhf.deb" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Linux arm because we have no DEB"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "armhf-${MS_TAG}.tar.gz" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Linux arm because we have no TAR"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
|
|
|
if [[ "$SHOULD_BUILD" != "yes" ]]; then
|
|
|
|
echo "Already have all the Linux arm builds"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
# linux-x64
|
|
|
|
else
|
|
|
|
if [[ -z $( contains "x86_64.rpm" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Linux x64 because we have no RPM"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "amd64.deb" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Linux x64 because we have no DEB"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-08 23:38:07 +00:00
|
|
|
if [[ -z $( contains "x64-$MS_TAG.tar.gz" ) ]]; then
|
2021-01-12 20:01:29 +00:00
|
|
|
echo "Building on Linux x64 because we have no TAR"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-09-15 20:28:27 +00:00
|
|
|
if [[ -z $( contains "x86_64.AppImage" ) ]]; then
|
|
|
|
echo "Building on Linux x64 because we have no AppImage"
|
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
fi
|
2021-01-12 20:01:29 +00:00
|
|
|
if [[ "$SHOULD_BUILD" != "yes" ]]; then
|
|
|
|
echo "Already have all the Linux x64 builds"
|
|
|
|
fi
|
2018-08-31 14:53:36 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Release assets do not exist at all, continuing build"
|
2018-08-13 18:24:40 +00:00
|
|
|
export SHOULD_BUILD="yes"
|
2018-10-04 22:05:05 +00:00
|
|
|
fi
|
2018-08-31 14:53:36 +00:00
|
|
|
fi
|
|
|
|
|
2020-10-05 23:31:17 +00:00
|
|
|
echo "SHOULD_BUILD=$SHOULD_BUILD" >> $GITHUB_ENV
|