How to implement automatic semantic versioning (SemVer) in Ignition?

I’m managing multiple Inductive Automation Ignition projects deployed across both development and production servers, and keeping them in sync—while tracking which version addresses specific requirements—has become increasingly difficult.
I'd thus like to introduce semantic versioning (SemVer) for my project.

My goal is to:

  • Store the project version in a JSON file within the project directory or accessible resource.
  • Use scripting to automatically increment the minor version number every time the project is saved or exported.
  • Maintain the typical SemVer format: major.minor.patch.

Questions:

  1. Is there a built-in hook or event in Ignition (e.g., during save/export) that I can tie into to trigger this script? for instance when saving a view or page or script?
  2. How can I reliably read/write to a JSON file from within Ignition's scripting environment?
  3. Is there a better alternative to tracking version info this way within Ignition?

Here's a simplified example of what I imagine the JSON structure might look like:

{
  "version": "1.4.2"
}

And a script (hypothetical) that on project update does something like:

import json
with open("project_version.json", "r") as f:
    data = json.load(f)
major, minor, patch = map(int, data["version"].split("."))
minor += 1  # Increment minor version
data["version"] = f"{major}.{minor}.{patch}"
with open("project_version.json", "w") as f:
    json.dump(data, f, indent=4)

Has anyone implemented something similar or have suggestions for integrating SemVer into Ignition projects?

  1. gateway events have an 'onUpdate' event, that should trigger on save:
  2. with open should work just fine.
  3. No idea

One thought, though:
If you're keeping the version in a json file, you might as well have 3 keys, one for each part of the version number. Then you can manipulate only the one you need, instead of splitting a string.
It's easy enough to bring the 3 parts together when you need to display the version.