@@ -58,6 +58,11 @@ def display_message_block(message: str) -> None:
58
58
print (divider )
59
59
60
60
61
+ def timestamp_build_number () -> int :
62
+ """Produce a numeric timestamp to use as build numbers"""
63
+ return int (time .strftime ('%Y%m%d%H%M%S' ))
64
+
65
+
61
66
def hash_file (path : Path ) -> str :
62
67
"""Calculate the hash of the file pointed at by `path`"""
63
68
with path .open ('rb' ) as f :
@@ -90,7 +95,7 @@ def _build_number_of_wheel_blob(wheel_path: Blob) -> int:
90
95
return int (build_number [0 ]) if build_number else - 1
91
96
92
97
93
- def upload (targets_dir , workflow_id ):
98
+ def upload (targets_dir ):
94
99
client = storage .Client ()
95
100
bucket = client .bucket (BUCKET_NAME )
96
101
artifact_types : set [str ] = set ()
@@ -143,7 +148,8 @@ def upload(targets_dir, workflow_id):
143
148
'with the same hash' )
144
149
continue
145
150
146
- artifact_name = f'{ name } -{ version } -{ workflow_id } -{ python_tag } -{ abi_tag } -{ platform_tag } .whl'
151
+ build_number = timestamp_build_number ()
152
+ artifact_name = f'{ name } -{ version } -{ build_number } -{ python_tag } -{ abi_tag } -{ platform_tag } .whl'
147
153
artifact = bucket .blob (f'{ artifact_type } /{ project_name } /{ artifact_name } ' )
148
154
149
155
print (f'{ padding } Artifact: { artifact_name } ' )
@@ -207,6 +213,5 @@ def upload(targets_dir, workflow_id):
207
213
if __name__ == '__main__' :
208
214
parser = argparse .ArgumentParser (prog = 'builder' , allow_abbrev = False )
209
215
parser .add_argument ('targets_dir' )
210
- parser .add_argument ('workflow_id' )
211
216
args = parser .parse_args ()
212
- upload (args .targets_dir , args . workflow_id )
217
+ upload (args .targets_dir )
0 commit comments