|
@@ -7,9 +7,32 @@ if [[ -z "${GITHUB_TOKEN}" ]]; then
|
|
exit
|
|
exit
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+VERSIONS_REPO="${GITHUB_USERNAME:-"VSCodium"}/versions"
|
|
|
|
+
|
|
REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}"
|
|
REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}"
|
|
-GITHUB_RESPONSE=$( curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${REPOSITORY}/releases/tags/${MS_TAG}")
|
|
|
|
-VSCODIUM_ASSETS=$( echo "${GITHUB_RESPONSE}" | jq -c '.assets | map(.name)?' )
|
|
|
|
|
|
+GITHUB_RESPONSE=$( curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/${REPOSITORY}/releases/tags/latest")
|
|
|
|
+LATEST_VERSION=$( echo "${GITHUB_RESPONSE}" | jq -c '.tag_name' )
|
|
|
|
+
|
|
|
|
+if [[ "${LATEST_VERSION}" =~ ^([0-9]+\.[0-9]+\.[0-9]+) ]]; then
|
|
|
|
+ if [ "${MS_TAG}" != "${BASH_REMATCH[1]}" ]; then
|
|
|
|
+ echo "New VSCode version, new build"
|
|
|
|
+ export SHOULD_BUILD="yes"
|
|
|
|
+
|
|
|
|
+ VSCODIUM_ASSETS="null"
|
|
|
|
+ elif [[ "${NEW_RELEASE}" == "yes" ]]; then
|
|
|
|
+ echo "New release build"
|
|
|
|
+ export SHOULD_BUILD="yes"
|
|
|
|
+
|
|
|
|
+ VSCODIUM_ASSETS="null"
|
|
|
|
+ else
|
|
|
|
+ export RELEASE_VERSION="${LATEST_VERSION}"
|
|
|
|
+ echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "${GITHUB_ENV}"
|
|
|
|
+
|
|
|
|
+ echo "Switch to release version: ${RELEASE_VERSION}"
|
|
|
|
+
|
|
|
|
+ VSCODIUM_ASSETS=$( echo "${GITHUB_RESPONSE}" | jq -c '.assets | map(.name)?' )
|
|
|
|
+ fi
|
|
|
|
+fi
|
|
|
|
|
|
contains() {
|
|
contains() {
|
|
# add " to match the end of a string so any hashs won't be matched by mistake
|
|
# add " to match the end of a string so any hashs won't be matched by mistake
|
|
@@ -19,21 +42,21 @@ contains() {
|
|
if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
# macos
|
|
# macos
|
|
if [[ "${OS_NAME}" == "osx" ]]; then
|
|
if [[ "${OS_NAME}" == "osx" ]]; then
|
|
- if [[ -z $( contains "VSCodium-darwin-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodium-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
echo "Building on MacOS because we have no ZIP"
|
|
echo "Building on MacOS because we have no ZIP"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_ZIP="no"
|
|
export SHOULD_BUILD_ZIP="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains ".${VSCODE_ARCH}.${MS_TAG}.dmg" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains ".${VSCODE_ARCH}.${RELEASE_VERSION}.dmg" ) ]]; then
|
|
echo "Building on MacOS because we have no DMG"
|
|
echo "Building on MacOS because we have no DMG"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_DMG="no"
|
|
export SHOULD_BUILD_DMG="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-darwin-${VSCODE_ARCH}-${MS_TAG}.tar.gz" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "vscodium-reh-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
echo "Building on MacOS because we have no REH archive"
|
|
echo "Building on MacOS because we have no REH archive"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
@@ -47,21 +70,21 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
|
|
|
# windows-arm64
|
|
# windows-arm64
|
|
if [[ ${VSCODE_ARCH} == "arm64" ]]; then
|
|
if [[ ${VSCODE_ARCH} == "arm64" ]]; then
|
|
- if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
echo "Building on Windows arm64 because we have no system setup"
|
|
echo "Building on Windows arm64 because we have no system setup"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_EXE_SYS="no"
|
|
export SHOULD_BUILD_EXE_SYS="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
echo "Building on Windows arm64 because we have no user setup"
|
|
echo "Building on Windows arm64 because we have no user setup"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_EXE_USR="no"
|
|
export SHOULD_BUILD_EXE_USR="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
echo "Building on Windows arm64 because we have no zip"
|
|
echo "Building on Windows arm64 because we have no zip"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
@@ -76,42 +99,42 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
|
|
|
# windows-ia32
|
|
# windows-ia32
|
|
elif [[ ${VSCODE_ARCH} == "ia32" ]]; then
|
|
elif [[ ${VSCODE_ARCH} == "ia32" ]]; then
|
|
- if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
echo "Building on Windows ia32 because we have no system setup"
|
|
echo "Building on Windows ia32 because we have no system setup"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_EXE_SYS="no"
|
|
export SHOULD_BUILD_EXE_SYS="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
echo "Building on Windows ia32 because we have no user setup"
|
|
echo "Building on Windows ia32 because we have no user setup"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_EXE_USR="no"
|
|
export SHOULD_BUILD_EXE_USR="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
echo "Building on Windows ia32 because we have no zip"
|
|
echo "Building on Windows ia32 because we have no zip"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_ZIP="no"
|
|
export SHOULD_BUILD_ZIP="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${MS_TAG}.msi" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
|
|
echo "Building on Windows ia32 because we have no msi"
|
|
echo "Building on Windows ia32 because we have no msi"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_MSI="no"
|
|
export SHOULD_BUILD_MSI="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${MS_TAG}.msi" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
|
|
echo "Building on Windows ia32 because we have no updates-disabled msi"
|
|
echo "Building on Windows ia32 because we have no updates-disabled msi"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_MSI_NOUP="no"
|
|
export SHOULD_BUILD_MSI_NOUP="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-win32-${VSCODE_ARCH}-${MS_TAG}.tar.gz" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "vscodium-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
echo "Building on Windows ia32 because we have no REH archive"
|
|
echo "Building on Windows ia32 because we have no REH archive"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
@@ -124,42 +147,42 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
|
|
|
|
# windows-x64
|
|
# windows-x64
|
|
else
|
|
else
|
|
- if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
echo "Building on Windows x64 because we have no system setup"
|
|
echo "Building on Windows x64 because we have no system setup"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_EXE_SYS="no"
|
|
export SHOULD_BUILD_EXE_SYS="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${RELEASE_VERSION}.exe" ) ]]; then
|
|
echo "Building on Windows x64 because we have no user setup"
|
|
echo "Building on Windows x64 because we have no user setup"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_EXE_USR="no"
|
|
export SHOULD_BUILD_EXE_USR="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodium-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.zip" ) ]]; then
|
|
echo "Building on Windows x64 because we have no zip"
|
|
echo "Building on Windows x64 because we have no zip"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_ZIP="no"
|
|
export SHOULD_BUILD_ZIP="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${MS_TAG}.msi" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${RELEASE_VERSION}.msi" ) ]]; then
|
|
echo "Building on Windows x64 because we have no msi"
|
|
echo "Building on Windows x64 because we have no msi"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_MSI="no"
|
|
export SHOULD_BUILD_MSI="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${MS_TAG}.msi" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${RELEASE_VERSION}.msi" ) ]]; then
|
|
echo "Building on Windows x64 because we have no updates-disabled msi"
|
|
echo "Building on Windows x64 because we have no updates-disabled msi"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_MSI_NOUP="no"
|
|
export SHOULD_BUILD_MSI_NOUP="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-win32-${VSCODE_ARCH}-${MS_TAG}.tar.gz" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "vscodium-reh-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
echo "Building on Windows x64 because we have no REH archive"
|
|
echo "Building on Windows x64 because we have no REH archive"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
@@ -188,14 +211,14 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
export SHOULD_BUILD_RPM="no"
|
|
export SHOULD_BUILD_RPM="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-linux-arm64-${MS_TAG}.tar.gz" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodium-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
echo "Building on Linux arm64 because we have no TAR"
|
|
echo "Building on Linux arm64 because we have no TAR"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_TAR="no"
|
|
export SHOULD_BUILD_TAR="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-linux-arm64-${MS_TAG}.tar.gz" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "vscodium-reh-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
echo "Building on Linux arm64 because we have no REH archive"
|
|
echo "Building on Linux arm64 because we have no REH archive"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
@@ -224,14 +247,14 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
export SHOULD_BUILD_RPM="no"
|
|
export SHOULD_BUILD_RPM="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-linux-armhf-${MS_TAG}.tar.gz" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodium-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
echo "Building on Linux arm because we have no TAR"
|
|
echo "Building on Linux arm because we have no TAR"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
export SHOULD_BUILD_TAR="no"
|
|
export SHOULD_BUILD_TAR="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-linux-armhf-${MS_TAG}.tar.gz" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "vscodium-reh-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
echo "Building on Linux arm because we have no REH archive"
|
|
echo "Building on Linux arm because we have no REH archive"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
@@ -260,7 +283,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
export SHOULD_BUILD_RPM="no"
|
|
export SHOULD_BUILD_RPM="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "VSCodium-linux-x64-${MS_TAG}.tar.gz" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "VSCodium-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
echo "Building on Linux x64 because we have no TAR"
|
|
echo "Building on Linux x64 because we have no TAR"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|
|
@@ -274,7 +297,7 @@ if [ "${VSCODIUM_ASSETS}" != "null" ]; then
|
|
export SHOULD_BUILD_APPIMAGE="no"
|
|
export SHOULD_BUILD_APPIMAGE="no"
|
|
fi
|
|
fi
|
|
|
|
|
|
- if [[ -z $( contains "vscodium-reh-linux-x64-${MS_TAG}.tar.gz" ) ]]; then
|
|
|
|
|
|
+ if [[ -z $( contains "vscodium-reh-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then
|
|
echo "Building on Linux x64 because we have no REH archive"
|
|
echo "Building on Linux x64 because we have no REH archive"
|
|
export SHOULD_BUILD="yes"
|
|
export SHOULD_BUILD="yes"
|
|
else
|
|
else
|