Skip to content

Commit

Permalink
Automatic Tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
Lypsilonx committed May 19, 2024
1 parent 6ceb4e9 commit 642323e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/autoTag.py
Original file line number Diff line number Diff line change
@@ -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}'")
5 changes: 5 additions & 0 deletions .github/workflows/updateVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.pdf
.updateVersion

0 comments on commit 642323e

Please sign in to comment.