Fix ESR check to check for a newer remote branch instead of an increment (#3314)
* Fix ESR check to check for a newer remote branch instead of an increment * Fix for major version
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
VERSION="$(jq -r '.version' <package.json)"
|
VERSION="$(jq -r '.version' <package.json)"
|
||||||
STABLE_VERSION="$(./node_modules/.bin/semver $VERSION -c)"
|
STABLE_VERSION="$(npx semver $VERSION -c)"
|
||||||
RELEASE_VERSION="${VERSION/$STABLE_VERSION/}"
|
RELEASE_VERSION="${VERSION/$STABLE_VERSION/}"
|
||||||
RELEASE_VERSION="${RELEASE_VERSION/-/}"
|
RELEASE_VERSION="${RELEASE_VERSION/-/}"
|
||||||
RELEASE_VERSION="${RELEASE_VERSION%.*}"
|
RELEASE_VERSION="${RELEASE_VERSION%.*}"
|
||||||
@@ -11,8 +11,11 @@ if [ "$RELEASE_VERSION" == "" ]; then
|
|||||||
RELEASE_VERSION="latest"
|
RELEASE_VERSION="latest"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If we are on a ESR branch, we don't want to generate the auto-updater yml for patch releases
|
# If we are on a ESR branch, we don't want to generate the auto-updater yml if there is a newer version
|
||||||
if [ -e .esr ] && [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[1-9][0-9]* ]]; then
|
NEXT_MINOR_VERSION="$(npx semver $STABLE_VERSION -i minor)"
|
||||||
|
NEXT_MAJOR_VERSION="$(npx semver $STABLE_VERSION -i major)"
|
||||||
|
NEWER_VERSION_EXISTS="$(git ls-remote --tags origin v${NEXT_MINOR_VERSION} v${NEXT_MAJOR_VERSION})"
|
||||||
|
if [ -e .esr ] && [ ! -z "$NEWER_VERSION_EXISTS" ]; then
|
||||||
echo "ESR branch, skipping auto-updater yml generation"
|
echo "ESR branch, skipping auto-updater yml generation"
|
||||||
rm ./release/"${RELEASE_VERSION}"*.yml
|
rm ./release/"${RELEASE_VERSION}"*.yml
|
||||||
exit 0
|
exit 0
|
||||||
|
Reference in New Issue
Block a user