From 012a06a156007bd19674815ea5764d0f5aab892a Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 31 Aug 2023 11:07:00 +0200 Subject: [PATCH] Split version checler and version extractor[skip ci] --- automation_tools/version_checker.sh | 45 ++++++++++++++------------- automation_tools/version_extractor.sh | 24 ++++++++++++++ 2 files changed, 47 insertions(+), 22 deletions(-) create mode 100644 automation_tools/version_extractor.sh diff --git a/automation_tools/version_checker.sh b/automation_tools/version_checker.sh index a16e163f..8190637c 100755 --- a/automation_tools/version_checker.sh +++ b/automation_tools/version_checker.sh @@ -1,6 +1,8 @@ #!/bin/bash # This script is used to check that the versions are correct and topping the pipeline if something is wrong. -# This is designed to be run on main pipeline to check that everything is in order before building RetroDECK. +# This is designed to be run on the main pipeline to check that everything is in order before building RetroDECK. + +source automation_tools/version_extractor.sh # Set the file paths appdata="net.retrodeck.retrodeck.appdata.xml" @@ -30,33 +32,32 @@ compare_versions() { return 0 # Versions are equal } -# Getting latest RetroDECK release info -LATEST_RELEASE=$(curl -s "https://api.github.com/repos/XargonWan/RetroDECK/releases/latest") -# Extracting tag name from the latest release -repo_version=$(echo "$LATEST_RELEASE" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') -# Printing results +repo_version=$(fetch_repo_version) echo -e "Online repository:\t$repo_version" -# Extract the version from the net.retrodeck.retrodeck.appdata.xml file -appdata_version=$(grep -oPm1 "(?<=