diff --git a/.github/workflows/autoTag.py b/.github/workflows/autoTag.py new file mode 100644 index 0000000..eb97add --- /dev/null +++ b/.github/workflows/autoTag.py @@ -0,0 +1,12 @@ +import os + +#look for the temp file in .git/info (.updateVersion) +if os.path.exists(".updateVersion"): + with open(".updateVersion", "r") as file: + new_version = file.read().strip() + + #remove the temp file + os.remove(".updateVersion") + + #tag the commit + os.system(f"git tag -a v{new_version} -m 'Version {new_version}'") \ No newline at end of file diff --git a/.github/workflows/updateVersion.py b/.github/workflows/updateVersion.py index bb7be79..9a0aa6b 100644 --- a/.github/workflows/updateVersion.py +++ b/.github/workflows/updateVersion.py @@ -35,6 +35,11 @@ def update_version(self, major, minor): #commit the changes os.system("git add data.typ") + #add temp file to .git/info to signal the version update + with open(".updateVersion", "w") as file: + file.write(new_version) + + # quit the application quit() diff --git a/.gitignore b/.gitignore index a136337..f53ec38 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.pdf +.updateVersion \ No newline at end of file