Files
materialious/update_versions.py
T
Ward 3bbc495d9b Update/1.12.0 (#1227)
* Explain why we need custom CORS headers.

* Translated using Weblate (German)

Currently translated at 100.0% (170 of 170 strings)

Translation: Materialious/Materialious
Translate-URL: https://toolate.othing.xyz/projects/materialious/materialious/de/

* Translated using Weblate (Alemannic)

Currently translated at 100.0% (170 of 170 strings)

Translation: Materialious/Materialious
Translate-URL: https://toolate.othing.xyz/projects/materialious/materialious/gsw/

* Bump svelte from 5.43.5 to 5.45.2 in /materialious

Bumps [svelte](https://github.com/sveltejs/svelte/tree/HEAD/packages/svelte) from 5.43.5 to 5.45.2.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/main/packages/svelte/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/commits/svelte@5.45.2/packages/svelte)

---
updated-dependencies:
- dependency-name: svelte
  dependency-version: 5.45.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump vite from 7.2.4 to 7.2.6 in /materialious

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.2.4 to 7.2.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v7.2.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 7.2.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @capacitor/core from 7.4.3 to 7.4.4 in /materialious

Bumps [@capacitor/core](https://github.com/ionic-team/capacitor) from 7.4.3 to 7.4.4.
- [Release notes](https://github.com/ionic-team/capacitor/releases)
- [Changelog](https://github.com/ionic-team/capacitor/blob/7.4.4/CHANGELOG.md)
- [Commits](https://github.com/ionic-team/capacitor/compare/7.4.3...7.4.4)

---
updated-dependencies:
- dependency-name: "@capacitor/core"
  dependency-version: 7.4.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump shaka-player from 4.16.10 to 4.16.11 in /materialious

Bumps [shaka-player](https://github.com/shaka-project/shaka-player) from 4.16.10 to 4.16.11.
- [Release notes](https://github.com/shaka-project/shaka-player/releases)
- [Changelog](https://github.com/shaka-project/shaka-player/blob/v4.16.11/CHANGELOG.md)
- [Commits](https://github.com/shaka-project/shaka-player/compare/v4.16.10...v4.16.11)

---
updated-dependencies:
- dependency-name: shaka-player
  dependency-version: 4.16.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump human-number from 2.0.7 to 2.0.8 in /materialious

Bumps [human-number](https://github.com/Kikobeats/human-number) from 2.0.7 to 2.0.8.
- [Release notes](https://github.com/Kikobeats/human-number/releases)
- [Changelog](https://github.com/Kikobeats/human-number/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Kikobeats/human-number/compare/v2.0.7...v2.0.8)

---
updated-dependencies:
- dependency-name: human-number
  dependency-version: 2.0.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump chokidar from 4.0.3 to 5.0.0 in /materialious/electron

Bumps [chokidar](https://github.com/paulmillr/chokidar) from 4.0.3 to 5.0.0.
- [Release notes](https://github.com/paulmillr/chokidar/releases)
- [Commits](https://github.com/paulmillr/chokidar/compare/4.0.3...5.0.0)

---
updated-dependencies:
- dependency-name: chokidar
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump electron from 39.2.3 to 39.2.4 in /materialious/electron

Bumps [electron](https://github.com/electron/electron) from 39.2.3 to 39.2.4.
- [Release notes](https://github.com/electron/electron/releases)
- [Commits](https://github.com/electron/electron/compare/v39.2.3...v39.2.4)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 39.2.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Translated using Weblate (German)

Currently translated at 100.0% (172 of 172 strings)

Translation: Materialious/Materialious
Translate-URL: https://toolate.othing.xyz/projects/materialious/materialious/de/

* Translated using Weblate (Alemannic)

Currently translated at 100.0% (172 of 172 strings)

Translation: Materialious/Materialious
Translate-URL: https://toolate.othing.xyz/projects/materialious/materialious/gsw/

* Translated using Weblate (Hungarian)

Currently translated at 100.0% (172 of 172 strings)

Translation: Materialious/Materialious
Translate-URL: https://toolate.othing.xyz/projects/materialious/materialious/hu/

* Add link to official RYD website

* Translated using Weblate (Latvian)

Currently translated at 73.2% (126 of 172 strings)

Translation: Materialious/Materialious
Translate-URL: https://toolate.othing.xyz/projects/materialious/materialious/lv/

* Bump version to 1.12.0

* Fix menu dropdown on theatre mode

* Fixe linting

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: mk-pmb <mk-pmb@users.noreply.github.com>
Co-authored-by: Lenny Angst <lenny@familie-angst.ch>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ghost of Sparta <makesocialfoss32@keemail.me>
Co-authored-by: ℂ𝕠𝕠𝕠𝕝 (𝕘𝕚𝕥𝕙𝕦𝕓.𝕔𝕠𝕞/ℂ𝕠𝕠𝕠𝕝) <toolate.othing.xyz.coool@privatepasta.com>
2025-12-06 01:27:28 +00:00

75 lines
2.4 KiB
Python

import json
import os
import re
from datetime import datetime
LATEST_VERSION = "1.12.0"
RELEASE_DATE = datetime.now().strftime("%Y-%-m-%d") # Format: YYYY-M-D
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.load(f_)
if package["version"] == LATEST_VERSION:
return
package["version"] = LATEST_VERSION
with open(location, "w") as f_:
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'<release version="{re.escape(LATEST_VERSION)}"', contents):
print(f"Release version {LATEST_VERSION} already exists.")
return
new_release = f"""
<release version="{LATEST_VERSION}" date="{RELEASE_DATE}">
<url>https://github.com/Materialious/Materialious/releases/tag/{LATEST_VERSION}</url>
</release>"""
# Insert the new release after the opening <releases> tag
updated_contents = re.sub(r"(<releases>\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)
update_android_version()
update_metainfo_release()