mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
ci: no UTC on this python
This commit is contained in:
+4
-4
@@ -2,7 +2,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
from zipfile import ZipFile, ZIP_DEFLATED
|
from zipfile import ZipFile, ZIP_DEFLATED
|
||||||
from b2sdk.v2 import InMemoryAccountInfo, B2Api
|
from b2sdk.v2 import InMemoryAccountInfo, B2Api
|
||||||
from datetime import datetime, UTC
|
from datetime import datetime, timezone
|
||||||
import json
|
import json
|
||||||
|
|
||||||
UPLOAD_FOLDER = "nightly/"
|
UPLOAD_FOLDER = "nightly/"
|
||||||
@@ -32,7 +32,7 @@ def remove_prefix(text: str, prefix: str) -> str:
|
|||||||
return text[text.startswith(prefix) and len(prefix):]
|
return text[text.startswith(prefix) and len(prefix):]
|
||||||
|
|
||||||
def create_and_upload_artifact_zip(platform: str, artifact: str) -> int:
|
def create_and_upload_artifact_zip(platform: str, artifact: str) -> int:
|
||||||
now = datetime.now(UTC).replace(hour=0, minute=0, second=0, microsecond=0)
|
now = datetime.now(timezone.utc).replace(hour=0, minute=0, second=0, microsecond=0)
|
||||||
|
|
||||||
source_archive: str
|
source_archive: str
|
||||||
destination_name = f'odin-{platform}-nightly+{now.strftime("%Y-%m-%d")}'
|
destination_name = f'odin-{platform}-nightly+{now.strftime("%Y-%m-%d")}'
|
||||||
@@ -71,7 +71,7 @@ def prune_artifacts():
|
|||||||
for file, _ in bucket.ls(UPLOAD_FOLDER, latest_only=False):
|
for file, _ in bucket.ls(UPLOAD_FOLDER, latest_only=False):
|
||||||
# Timestamp is in milliseconds
|
# Timestamp is in milliseconds
|
||||||
date = datetime.fromtimestamp(file.upload_timestamp / 1_000.0).replace(hour=0, minute=0, second=0, microsecond=0)
|
date = datetime.fromtimestamp(file.upload_timestamp / 1_000.0).replace(hour=0, minute=0, second=0, microsecond=0)
|
||||||
now = datetime.now(UTC).replace(hour=0, minute=0, second=0, microsecond=0)
|
now = datetime.now(timezone.utc).replace(hour=0, minute=0, second=0, microsecond=0)
|
||||||
delta = now - date
|
delta = now - date
|
||||||
|
|
||||||
if delta.days > int(days_to_keep):
|
if delta.days > int(days_to_keep):
|
||||||
@@ -105,7 +105,7 @@ def update_nightly_json():
|
|||||||
'sizeInBytes': size,
|
'sizeInBytes': size,
|
||||||
})
|
})
|
||||||
|
|
||||||
now = datetime.now(UTC).isoformat()
|
now = datetime.now(timezone.utc).isoformat()
|
||||||
|
|
||||||
nightly = json.dumps({
|
nightly = json.dumps({
|
||||||
'last_updated' : now,
|
'last_updated' : now,
|
||||||
|
|||||||
Reference in New Issue
Block a user