aboutsummaryrefslogtreecommitdiff
path: root/scripts/check_version_numbers.py
blob: a3bb0e28dd1ca0e34f95489b1c522b9140177cbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# %%
""""Ensure that version numbers between `tauri.conf.json`, `cargo.toml`, and GitHub release are the same"""
import json
import toml
import sys

with open("src-tauri/tauri.conf.json", "rt") as f:
    tauri_conf_json = json.load(f)

with open("src-tauri/Cargo.toml", "rt") as f:
    Cargo_toml = toml.load(f)

tauri_conf_json_version = tauri_conf_json["version"]
Cargo_toml_version = Cargo_toml["package"]["version"]

# Ensure same
assert(tauri_conf_json_version == Cargo_toml_version)

# Check release tag additionally if release
if "--release" in sys.argv:
    print("TODO")
    release_tag = sys.argv[2]
    print(release_tag)
    assert(release_tag == f"v{tauri_conf_json_version}")