From 91bc8ab562e8c6bc167b240a1f9f00ebbecd9775 Mon Sep 17 00:00:00 2001 From: silentJET85 Date: Wed, 1 Jan 2025 18:02:52 -0600 Subject: [PATCH 1/3] feat(ci) add version test --- .github/workflows/tests-01-main.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-01-main.yml b/.github/workflows/tests-01-main.yml index 723fb1dd8..8ca0ce81b 100644 --- a/.github/workflows/tests-01-main.yml +++ b/.github/workflows/tests-01-main.yml @@ -51,7 +51,16 @@ jobs: echo "Failed to detect ${APP} as installed" >&2 exit 1 else - ./deb-get purge "${APP}" + PUBLISHED_VER=$(./deb-get show "${APP}" | grep "Published:" | grep -oE '[^[:space:]]+$' || :) + INSTALLED_VER=$(./deb-get show "${APP}" | grep "Installed:" | grep -oE '[^[:space:]]+$' || :) + if [ ! -z "${PUBLISHED_VER// /}" ] && [ "${PUBLISHED_VER}" != "${INSTALLED_VER}" ]; then + echo "Versions do not match. The package's VERSION_PUBLISHED variable may need to be changed." >&2 + echo "Published Version: ${PUBLISHED_VER}" + echo "Installed Version: ${INSTALLED_VER}" + exit 1 + else + ./deb-get purge "${APP}" + fi fi fi done From 93faf8a516504d149d12ff4ae7b5f923cdbff769 Mon Sep 17 00:00:00 2001 From: silentJET85 <81664312+silentJET85@users.noreply.github.com> Date: Sat, 4 Jan 2025 18:09:18 -0600 Subject: [PATCH 2/3] Update .github/workflows/tests-01-main.yml Co-authored-by: Phil Clifford --- .github/workflows/tests-01-main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-01-main.yml b/.github/workflows/tests-01-main.yml index 8ca0ce81b..b0d5cc10c 100644 --- a/.github/workflows/tests-01-main.yml +++ b/.github/workflows/tests-01-main.yml @@ -52,7 +52,7 @@ jobs: exit 1 else PUBLISHED_VER=$(./deb-get show "${APP}" | grep "Published:" | grep -oE '[^[:space:]]+$' || :) - INSTALLED_VER=$(./deb-get show "${APP}" | grep "Installed:" | grep -oE '[^[:space:]]+$' || :) + INSTALLED_VER=$(dpkg-query -Wf '${Version}' "${APP}" || :) if [ ! -z "${PUBLISHED_VER// /}" ] && [ "${PUBLISHED_VER}" != "${INSTALLED_VER}" ]; then echo "Versions do not match. The package's VERSION_PUBLISHED variable may need to be changed." >&2 echo "Published Version: ${PUBLISHED_VER}" From c39812f9f4e60249c45d455991351aebdabfbe8e Mon Sep 17 00:00:00 2001 From: silentJET85 <81664312+silentJET85@users.noreply.github.com> Date: Fri, 10 Jan 2025 20:09:59 -0600 Subject: [PATCH 3/3] Update .github/workflows/tests-01-main.yml Co-authored-by: Phil Clifford --- .github/workflows/tests-01-main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-01-main.yml b/.github/workflows/tests-01-main.yml index b0d5cc10c..e267add53 100644 --- a/.github/workflows/tests-01-main.yml +++ b/.github/workflows/tests-01-main.yml @@ -53,7 +53,7 @@ jobs: else PUBLISHED_VER=$(./deb-get show "${APP}" | grep "Published:" | grep -oE '[^[:space:]]+$' || :) INSTALLED_VER=$(dpkg-query -Wf '${Version}' "${APP}" || :) - if [ ! -z "${PUBLISHED_VER// /}" ] && [ "${PUBLISHED_VER}" != "${INSTALLED_VER}" ]; then + if [ -n "${PUBLISHED_VER// /}" ] && dpkg --compare-versions "${PUBLISHED_VER}" gt "${INSTALLED_VER}" ; then echo "Versions do not match. The package's VERSION_PUBLISHED variable may need to be changed." >&2 echo "Published Version: ${PUBLISHED_VER}" echo "Installed Version: ${INSTALLED_VER}"