Add documentation to release.py
This commit is contained in:
+15
-3
@@ -1,17 +1,29 @@
|
|||||||
|
"""
|
||||||
|
A release script to build and tag docker files, commit changes, and create release tags.
|
||||||
|
|
||||||
|
It requires `toml` to be installed (in Ubuntu via `sudo apt install python3 python3-toml` and then
|
||||||
|
`python3 release.py`).
|
||||||
|
|
||||||
|
Bump the version manually in Cargo.toml before running this script. You'll be asked for
|
||||||
|
confirmation before running all the steps, so you're safe if you forget.
|
||||||
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import toml
|
import toml
|
||||||
|
|
||||||
|
|
||||||
def get_release_version():
|
def get_release_version():
|
||||||
"""
|
"""
|
||||||
Reads the version from the Cargo.toml file.
|
Reads the version from the Cargo.toml file.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cargo_toml_path = os.path.join(os.path.dirname(__file__), 'Cargo.toml')
|
cargo_toml_path = os.path.join(os.path.dirname(__file__), "Cargo.toml")
|
||||||
|
|
||||||
with open(cargo_toml_path, 'r', encoding="UTF-8") as f:
|
with open(cargo_toml_path, "r", encoding="UTF-8") as f:
|
||||||
cargo_toml = toml.load(f)
|
cargo_toml = toml.load(f)
|
||||||
|
|
||||||
return cargo_toml['package']['version']
|
return cargo_toml["package"]["version"]
|
||||||
|
|
||||||
|
|
||||||
version = get_release_version()
|
version = get_release_version()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user