Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include date in pre-release version #1472

Merged
merged 2 commits into from
Mar 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions scripts/version_util.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/env python3
#!/usr/bin/env python3

"""
Script should only be called by the CI system.
Expand All @@ -16,6 +16,7 @@
import re
import subprocess
import sys
from datetime import datetime
from typing import Final

import semver
Expand Down Expand Up @@ -90,7 +91,8 @@ def main() -> None:
cargo_version = get_cargo_version(cargo_toml)

if sys.argv[1] == "--patch_prerelease":
new_version = f"{cargo_version}+{get_git_sha()}"
date = datetime.now().strftime("%Y-%m-%d")
new_version = f"{cargo_version}+{date}-{get_git_sha()}"
new_cargo_toml = patch_cargo_version(cargo_toml, new_version)

# Write the patched Cargo.toml back to disk
Expand Down