poetry2nix/tools/auto_version.py
2023-11-03 00:23:00 +13:00

10 lines
330 B
Python
Executable file

#!/usr/bin/env python3
from datetime import datetime
# Outputs a version number to be tagged by github actions
if __name__ == "__main__":
now = datetime.utcnow()
modifier = int(
(now - now.replace(hour=0, minute=0, second=0, microsecond=0)).total_seconds()
)
print(now.strftime(f"%-Y.%-m.%-d{modifier}"))