mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 04:46:44 -06:00
[Actions] Use Europe/Warsaw timezone for build dates
This commit is contained in:
parent
6a7020a516
commit
f795412551
11
.github/utils/bump_nightly.py
vendored
11
.github/utils/bump_nightly.py
vendored
@ -1,7 +1,7 @@
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from datetime import datetime, timedelta
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
from _utils import (
|
||||
get_commit_log,
|
||||
@ -15,19 +15,12 @@ if __name__ == "__main__":
|
||||
print("usage: bump_nightly.py <project dir>")
|
||||
exit(-1)
|
||||
|
||||
repo = os.getenv("GITHUB_REPOSITORY")
|
||||
sha = os.getenv("GITHUB_SHA")
|
||||
|
||||
if not repo or not sha:
|
||||
print("Missing GitHub environment variables.")
|
||||
exit(-1)
|
||||
|
||||
project_dir = get_project_dir()
|
||||
|
||||
(version_code, version_name) = read_gradle_version(project_dir)
|
||||
version_name = version_name.split("+")[0]
|
||||
|
||||
date = datetime.now()
|
||||
date = datetime.now(tz=ZoneInfo("Europe/Warsaw"))
|
||||
if date.hour > 6:
|
||||
version_name += "+daily." + date.strftime("%Y%m%d-%H%M")
|
||||
else:
|
||||
|
6
.github/utils/save_version.py
vendored
6
.github/utils/save_version.py
vendored
@ -3,6 +3,7 @@ import os
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from time import time
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
import mysql.connector as mysql
|
||||
from dotenv import load_dotenv
|
||||
@ -59,7 +60,10 @@ def save_version(
|
||||
build_date = int(os.stat(file).st_mtime)
|
||||
bundle_name_play = output_aab_play
|
||||
|
||||
build_date = datetime.fromtimestamp(build_date).strftime("%Y-%m-%d %H:%M:%S")
|
||||
build_date = datetime.fromtimestamp(
|
||||
build_date,
|
||||
tz=ZoneInfo("Europe/Warsaw"),
|
||||
).strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
if build_type in ["nightly", "daily"]:
|
||||
download_url = apk_server_nightly + apk_name if apk_name else None
|
||||
|
6
.github/utils/webhook_discord.py
vendored
6
.github/utils/webhook_discord.py
vendored
@ -1,6 +1,7 @@
|
||||
import os
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
import requests
|
||||
from dotenv import load_dotenv
|
||||
@ -27,7 +28,10 @@ def post_webhook(
|
||||
if testing:
|
||||
build_date = int(os.stat(apk_file).st_mtime)
|
||||
if build_date:
|
||||
build_date = datetime.fromtimestamp(build_date).strftime("%Y-%m-%d %H:%M")
|
||||
build_date = datetime.fromtimestamp(
|
||||
build_date,
|
||||
tz=ZoneInfo("Europe/Warsaw"),
|
||||
).strftime("%Y-%m-%d %H:%M")
|
||||
|
||||
# untagged release, get commit log
|
||||
if build_type in ["nightly", "daily"]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user