Browse Source

Detect if beta is true

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 1 year ago
parent
commit
f2aff7a12c

+ 0 - 21
.github/workflows/detectSnapshot.yml

@@ -1,21 +0,0 @@
-name: "Detect snapshot"
-
-on:
-    pull_request:
-        branches: [ master, stable-* ]
-
-# Declare default permissions as read only.
-permissions: read-all
-
-concurrency: 
-    group: detect-snapshot-${{ github.head_ref || github.run_id }}
-    cancel-in-progress: true
-
-jobs:
-    detectSnapshot:
-        runs-on: ubuntu-latest
-
-        steps:
-            -   uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
-            -   name: Detect SNAPSHOT
-                run: scripts/analysis/detectSNAPSHOT.sh

+ 26 - 0
.github/workflows/detectWrongSettings.yml

@@ -0,0 +1,26 @@
+name: "Detect wrong settings"
+
+on:
+    pull_request:
+        branches: [ master, stable-* ]
+
+# Declare default permissions as read only.
+permissions: read-all
+
+concurrency:
+    group: detect-wrong-settings-${{ github.head_ref || github.run_id }}
+    cancel-in-progress: true
+
+jobs:
+    detectWrongSettings:
+        runs-on: ubuntu-22.04
+
+        steps:
+            -   uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
+            -   name: Set up JDK 17
+                uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3
+                with:
+                    distribution: "temurin"
+                    java-version: 17
+            -   name: Detect SNAPSHOT
+                run: scripts/analysis/detectWrongSettings.sh

+ 1 - 1
app/src/main/res/values/setup.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <!-- Beta indicator -->
-    <bool name="is_beta">true</bool>
+    <bool name="is_beta">false</bool>
     <bool name="dev_version_direct_download_enabled">false</bool>
 
     <!-- App name  and other strings-->

+ 0 - 10
scripts/analysis/detectSNAPSHOT.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-
-count=$(./gradlew dependencies | grep SNAPSHOT | grep -v "com.github.nextcloud:android-library" -c)
-
-if [ $count -eq 0 ] ; then
-    exit 0
-else
-    exit 1
-fi
-

+ 11 - 0
scripts/analysis/detectWrongSettings.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+snapshotCount=$(./gradlew dependencies | grep SNAPSHOT | grep -v "com.github.nextcloud:android-library" -c)
+betaCount=$(grep "<bool name=\"is_beta\">true</bool>" app/src/main/res/values/setup.xml -c)
+
+if [[ $snapshotCount -eq 0 && $betaCount -eq 0 ]] ; then
+    exit 0
+else
+    exit 1
+fi
+