From 4618fa32f39abb4f134ecee2cebef685149b4340 Mon Sep 17 00:00:00 2001 From: Matthew Dean Date: Tue, 21 Mar 2023 12:49:35 +0000 Subject: [PATCH] Bug/check-version (#58) * testing check version output * yq output * try -o * fic check-version * 2.9.9 --- package-lock.json | 4 ++-- package.json | 2 +- scripts/check-version.sh | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index a09717d..5ed929c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@digicatapult/dscp-ipfs", - "version": "2.9.8", + "version": "2.9.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@digicatapult/dscp-ipfs", - "version": "2.9.8", + "version": "2.9.9", "license": "Apache-2.0", "dependencies": { "@polkadot/api": "^10.1.4", diff --git a/package.json b/package.json index c337b44..99df74b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@digicatapult/dscp-ipfs", - "version": "2.9.8", + "version": "2.9.9", "description": "Service for DSCP", "main": "app/index.js", "type": "module", diff --git a/scripts/check-version.sh b/scripts/check-version.sh index 919a600..9b0e167 100755 --- a/scripts/check-version.sh +++ b/scripts/check-version.sh @@ -4,8 +4,8 @@ set -e function check_versions_consistent () { - local PACKAGE_VERSION=$(yq eval '.version' ./package.json) - local PACKAGE_LOCK_VERSION=$(yq eval '.version' ./package-lock.json) + local PACKAGE_VERSION=$(yq eval -o y '.version' ./package.json) + local PACKAGE_LOCK_VERSION=$(yq eval -o y '.version' ./package-lock.json) if [ "$PACKAGE_VERSION" != "$PACKAGE_LOCK_VERSION" ]; then echo "Inconsistent versions detected" @@ -40,7 +40,7 @@ function check_version_greater () { # Get published git tags that match semver regex with a "v" prefix then remove the "v" character PUBLISHED_VERSIONS=$(git tag | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+\(\-[a-zA-Z-]\+\(\.[0-9]\+\)*\)\{0,1\}$" | sed 's/^v\(.*\)$/\1/') # Get the current version from package.json -CURRENT_VERSION=$(yq eval '.version' ./package.json) +CURRENT_VERSION=$(yq eval -o y '.version' ./package.json) if check_version_greater "$CURRENT_VERSION" "$PUBLISHED_VERSIONS"; then echo "VERSION=v$CURRENT_VERSION" >> $GITHUB_OUTPUT