diff --git a/materialious/android/app/build.gradle b/materialious/android/app/build.gradle
index 184a9c7e..536d07c1 100644
--- a/materialious/android/app/build.gradle
+++ b/materialious/android/app/build.gradle
@@ -7,8 +7,8 @@ android {
applicationId "us.materialio.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 92
- versionName "1.7.10"
+ versionCode 93
+ versionName "1.7.11"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
diff --git a/materialious/electron/materialious.metainfo.xml b/materialious/electron/materialious.metainfo.xml
index 543e298d..3273fd90 100644
--- a/materialious/electron/materialious.metainfo.xml
+++ b/materialious/electron/materialious.metainfo.xml
@@ -53,7 +53,11 @@
intense
-
+
+
+ https://github.com/Materialious/Materialious/releases/tag/1.7.11
+
+
https://github.com/Materialious/Materialious/releases/tag/1.6.25
diff --git a/materialious/electron/package.json b/materialious/electron/package.json
index d845118b..b298db55 100644
--- a/materialious/electron/package.json
+++ b/materialious/electron/package.json
@@ -1,6 +1,6 @@
{
"name": "Materialious",
- "version": "1.7.10",
+ "version": "1.7.11",
"description": "Modern material design for Invidious.",
"author": {
"name": "Ward Pearce",
diff --git a/materialious/package.json b/materialious/package.json
index 96d410bb..7c0b6768 100644
--- a/materialious/package.json
+++ b/materialious/package.json
@@ -1,6 +1,6 @@
{
"name": "materialious",
- "version": "1.7.10",
+ "version": "1.7.11",
"private": true,
"scripts": {
"dev": "vite dev",
diff --git a/update_versions.py b/update_versions.py
index 55d9eb7c..769ec3f4 100644
--- a/update_versions.py
+++ b/update_versions.py
@@ -1,54 +1,72 @@
-"""Small script for keeping versioning consistent for Materialious
-"""
-
import json
import os
import re
+from datetime import datetime
+
+LATEST_VERSION = "1.7.11"
+RELEASE_DATE = datetime.now().strftime("%Y-%-m-%d") # Format: YYYY-M-D
-LATEST_VERSION = "1.7.10"
WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")
ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json")
ELECTRON_PACKAGE = os.path.join(WORKING_DIR, "electron", "package.json")
ANDROID_PACKAGE = os.path.join(WORKING_DIR, "android", "app", "build.gradle")
+METAINFO_FILE = os.path.join(WORKING_DIR, "electron", "materialious.metainfo.xml")
def package_json_update_ver(location: str) -> None:
with open(location, "r") as f_:
- package = json.loads(f_.read())
+ package = json.load(f_)
if package["version"] == LATEST_VERSION:
return
-
package["version"] = LATEST_VERSION
with open(location, "w") as f_:
- f_.write(json.dumps(package, indent="\t"))
+ json.dump(package, f_, indent="\t")
+
+
+def update_android_version() -> None:
+ with open(ANDROID_PACKAGE, "r") as f_:
+ contents = f_.read()
+
+ version_code_match = re.search(r"versionCode\s+(\d+)", contents)
+ version_name_match = re.search(r'versionName\s+"([^"]+)"', contents)
+
+ if version_code_match and version_name_match:
+ version_code = int(version_code_match.group(1)) + 1
+ contents = re.sub(r"versionCode\s+\d+", f"versionCode {version_code}", contents)
+ contents = re.sub(
+ r'versionName\s+"[^"]+"', f'versionName "{LATEST_VERSION}"', contents
+ )
+
+ with open(ANDROID_PACKAGE, "w") as f_:
+ f_.write(contents)
+
+
+def update_metainfo_release() -> None:
+ with open(METAINFO_FILE, "r") as f_:
+ contents = f_.read()
+
+ # Check if the version already exists in the releases
+ if re.search(rf'
+ https://github.com/Materialious/Materialious/releases/tag/{LATEST_VERSION}
+ """
+
+ # Insert the new release after the opening tag
+ updated_contents = re.sub(r"(\s*)", rf"\1{new_release}\n", contents)
+
+ with open(METAINFO_FILE, "w") as f_:
+ f_.write(updated_contents)
if __name__ == "__main__":
for location in (ROOT_PACKAGE, ELECTRON_PACKAGE):
package_json_update_ver(location)
- with open(ANDROID_PACKAGE, "r") as f_:
- contents = f_.read()
-
- version_code_match = re.search(r"versionCode\s+(\d+)", contents)
- version_name_match = re.search(r'versionName\s+"([^"]+)"', contents)
-
- if version_code_match and version_name_match:
- version_code = version_code_match.group(1)
- version_name = version_name_match.group(1)
-
- f_.close()
-
- with open(ANDROID_PACKAGE, "w") as f_:
- new_version_code = int(version_code) + 1
-
- f_.write(
- contents.replace(
- f"versionCode {version_code}", f"versionCode {new_version_code}"
- ).replace(
- f'versionName "{version_name}"',
- f'versionName "{LATEST_VERSION}"',
- )
- )
+ update_android_version()
+ update_metainfo_release()