From 68652bf0ca590ecbf4223478ca83a507eb9fde63 Mon Sep 17 00:00:00 2001
From: Nick Molcanov <32801560+nck-mlcnv@users.noreply.github.com>
Date: Mon, 7 Oct 2024 16:11:51 +0200
Subject: [PATCH] Add github action for checking ontology version
---
.github/scripts/check_schema_version.sh | 19 +++++++++++++++++++
.github/workflows/check_version.yml | 3 ++-
pom.xml | 2 +-
3 files changed, 22 insertions(+), 2 deletions(-)
create mode 100644 .github/scripts/check_schema_version.sh
diff --git a/.github/scripts/check_schema_version.sh b/.github/scripts/check_schema_version.sh
new file mode 100644
index 000000000..819aea80e
--- /dev/null
+++ b/.github/scripts/check_schema_version.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
+ONTOLOGY_VERSION=$(mvn help:evaluate -Dexpression=ontology.version -q -DforceStdout)
+
+# Check for changes and compare versions
+if git diff --quiet "main:$(git ls-tree -r --name-only main | grep 'iguana.owx')" 'src/main/resources/iguana.owx'; then
+ DIFF_STATUS=0
+else
+ DIFF_STATUS=1
+fi
+
+if [ $DIFF_STATUS = '1' ] && [ "$PROJECT_VERSION" != "$ONTOLOGY_VERSION" ];
+then
+ echo "Schema has changed, update ontology version to the project version inside the pom!"
+ exit 1
+fi
+
+exit 0
diff --git a/.github/workflows/check_version.yml b/.github/workflows/check_version.yml
index 770bf137c..f15f65cba 100644
--- a/.github/workflows/check_version.yml
+++ b/.github/workflows/check_version.yml
@@ -8,4 +8,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- - run: .github/scripts/tagcheck.sh v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
\ No newline at end of file
+ - run: .github/scripts/tagcheck.sh v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
+ - run: .github/scripts/check_schema_version.sh
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 5c26f8517..c0faee31b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,7 +40,7 @@
1
0
- 4.1.0
+ 4.0.0
17
4.2.0