From 8e109a24ccc987d759df91d7c73ae3f97b72b088 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 20 Dec 2023 09:41:16 +0100 Subject: [PATCH] Fixing the mess after the merge (hopefully) - Pt. 2 --- .github/workflows/main-selfhosted.yml | 2 +- automation_tools/main_version_checker.sh | 34 +++++++++++++++++-- ...t-validation.sh => manifest_validation.sh} | 0 3 files changed, 32 insertions(+), 4 deletions(-) rename automation_tools/{manifest-validation.sh => manifest_validation.sh} (100%) diff --git a/.github/workflows/main-selfhosted.yml b/.github/workflows/main-selfhosted.yml index 5bb301a2..d768c5a3 100644 --- a/.github/workflows/main-selfhosted.yml +++ b/.github/workflows/main-selfhosted.yml @@ -60,7 +60,7 @@ jobs: - name: Validate Manifest (main only) id: validate_manifest - run: "automation_tools/manifest-validation.sh" + run: "automation_tools/manifest_validation.sh" - name: "[DEBUG] Outputting manifest" run: cat net.retrodeck.retrodeck.yml diff --git a/automation_tools/main_version_checker.sh b/automation_tools/main_version_checker.sh index b5c68269..71cc8f1e 100755 --- a/automation_tools/main_version_checker.sh +++ b/automation_tools/main_version_checker.sh @@ -1,12 +1,16 @@ #!/bin/bash -# This script is used to check that the versions are correct and stopping the pipeline if something is wrong. -# This is designed to be run on the main pipeline to check that everything is in order before building RetroDECK. + +# This script is intended to gather version information from various sources: +# RetroDECK repository +# Appdata.xml file +# Manifest YAML file +# It consists of three functions, each responsible for retrieving a specific version-related data. source automation_tools/version_extractor.sh -# Set the file paths appdata="net.retrodeck.retrodeck.appdata.xml" manifest="net.retrodeck.retrodeck.yml" +manifest_content=$(cat "$manifest") compare_versions() { local manifest_version_cleaned=$(echo "$1" | sed 's/[a-zA-Z]//g') @@ -31,6 +35,30 @@ compare_versions() { return 0 # Versions are equal } + +fetch_repo_version(){ + # 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 + echo "$repo_version" +} + +fetch_appdata_version(){ + # Extract the version from the net.retrodeck.retrodeck.appdata.xml file + appdata_version=$(grep -oPm1 "(?<=