|
@@ -7,13 +7,8 @@ if [[ -z "${GITHUB_TOKEN}" ]]; then
|
|
|
exit
|
|
|
fi
|
|
|
|
|
|
-if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
|
|
|
- REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}-insiders"
|
|
|
-else
|
|
|
- REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}"
|
|
|
-fi
|
|
|
-
|
|
|
-GITHUB_RESPONSE=$( curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${REPOSITORY}/releases/latest" )
|
|
|
+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
|
|
@@ -40,29 +35,29 @@ if [[ "${LATEST_VERSION}" =~ ^([0-9]+\.[0-9]+\.[0-9]+) ]]; then
|
|
|
|
|
|
echo "Switch to release version: ${RELEASE_VERSION}"
|
|
|
|
|
|
- VSCODIUM_ASSETS=$( echo "${GITHUB_RESPONSE}" | jq -c '.assets | map(.name)?' )
|
|
|
+ ASSETS=$( echo "${GITHUB_RESPONSE}" | jq -c '.assets | map(.name)?' )
|
|
|
else
|
|
|
- VSCODIUM_ASSETS="null"
|
|
|
+ ASSETS="null"
|
|
|
fi
|
|
|
fi
|
|
|
|
|
|
contains() {
|
|
|
# add " to match the end of a string so any hashs won't be matched by mistake
|
|
|
- echo "${VSCODIUM_ASSETS}" | grep "${1}\""
|
|
|
+ echo "${ASSETS}" | grep "${1}\""
|
|
|
}
|
|
|
|
|
|
-if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
+if [ "${ASSETS}" != "null" ]; then
|
|
|
# macos
|
|
|
if [[ "${OS_NAME}" == "osx" ]]; then
|
|
|
if [[ "${VSCODE_QUALITY}" == "insider" && "${VSCODE_ARCH}" == "arm64" ]]; then
|
|
|
- if [[ -z $( contains "VSCodium-${RELEASE_VERSION}-src.tar.gz" ) || -z $( contains "VSCodium-${RELEASE_VERSION}-src.zip" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-${RELEASE_VERSION}-src.tar.gz" ) || -z $( contains "${APP_NAME}-${RELEASE_VERSION}-src.zip" ) ]]; then
|
|
|
echo "Building on MacOS because we have no SRC"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
export SHOULD_BUILD_SRC="yes"
|
|
|
fi
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
|
echo "Building on MacOS because we have no ZIP"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
@@ -76,7 +71,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
export SHOULD_BUILD_DMG="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME_LC}-reh-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
echo "Building on MacOS because we have no REH archive"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
@@ -90,7 +85,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
|
|
|
# windows-arm64
|
|
|
if [[ "${VSCODE_ARCH}" == "arm64" ]]; then
|
|
|
- if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
|
echo "Building on Windows arm64 because we have no system setup"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
@@ -104,7 +99,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
export SHOULD_BUILD_EXE_USR="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
|
echo "Building on Windows arm64 because we have no zip"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
@@ -119,7 +114,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
|
|
|
# windows-ia32
|
|
|
elif [[ "${VSCODE_ARCH}" == "ia32" ]]; then
|
|
|
- if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
|
echo "Building on Windows ia32 because we have no system setup"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
@@ -133,28 +128,28 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
export SHOULD_BUILD_EXE_USR="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
|
echo "Building on Windows ia32 because we have no zip"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
|
export SHOULD_BUILD_ZIP="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
|
|
|
echo "Building on Windows ia32 because we have no msi"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
|
export SHOULD_BUILD_MSI="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
|
|
|
echo "Building on Windows ia32 because we have no updates-disabled msi"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
|
export SHOULD_BUILD_MSI_NOUP="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME_LC}-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
echo "Building on Windows ia32 because we have no REH archive"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
@@ -167,7 +162,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
|
|
|
# windows-x64
|
|
|
else
|
|
|
- if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}Setup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
|
echo "Building on Windows x64 because we have no system setup"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
@@ -181,28 +176,28 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
export SHOULD_BUILD_EXE_USR="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
|
echo "Building on Windows x64 because we have no zip"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
|
export SHOULD_BUILD_ZIP="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
|
|
|
echo "Building on Windows x64 because we have no msi"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
|
export SHOULD_BUILD_MSI="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
|
|
|
echo "Building on Windows x64 because we have no updates-disabled msi"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
|
export SHOULD_BUILD_MSI_NOUP="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME_LC}-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
echo "Building on Windows x64 because we have no REH archive"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
@@ -231,14 +226,14 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
export SHOULD_BUILD_RPM="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
echo "Building on Linux arm64 because we have no TAR"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
|
export SHOULD_BUILD_TAR="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME_LC}-reh-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
echo "Building on Linux arm64 because we have no REH archive"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
@@ -267,14 +262,14 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
export SHOULD_BUILD_RPM="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
echo "Building on Linux arm because we have no TAR"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
|
export SHOULD_BUILD_TAR="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME_LC}-reh-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
echo "Building on Linux arm because we have no REH archive"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
@@ -303,7 +298,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
export SHOULD_BUILD_RPM="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME}-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
echo "Building on Linux x64 because we have no TAR"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|
|
@@ -317,7 +312,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
export SHOULD_BUILD_APPIMAGE="no"
|
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
+ if [[ -z $( contains "${APP_NAME_LC}-reh-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
|
echo "Building on Linux x64 because we have no REH archive"
|
|
|
export SHOULD_BUILD="yes"
|
|
|
else
|