summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2024-01-28 18:11:05 -0500
committerGitHub <noreply@github.com>2024-01-28 18:11:05 -0500
commitdb9e97a0df805388ba15fe097848a37a21fbdc31 (patch)
tree369ec03cdcb3ba90c04cccbccc81e973189850d3 /scripts
parenta377e93ecc974eaccb4f3ae88d68f6a01ef8247e (diff)
ci: update upload-artifact to v4.3.0 and download-artifact to v4.1.1 (#1399)
* ci: update upload-artifact to v4.3.0 and download-artifact to v4.1.1 * fix rpm/deb * add exception for quay; idk what I'll do once node support is gone * fix broken script * fix download * migrate 2-17 to cirrus to avoid node deprecation warnings * prevent cirrus cancellation * update cache to work with linux * simplify cache * update some comments * add timeouts
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cirrus/build.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/scripts/cirrus/build.py b/scripts/cirrus/build.py
index 3e2667fd..421c777c 100644
--- a/scripts/cirrus/build.py
+++ b/scripts/cirrus/build.py
@@ -4,6 +4,8 @@
# through Cirrus CI's GraphQL interface.
#
# Expects the Cirrus CI API key to be set in the CIRRUS_KEY environment variable.
+#
+# TODO: Explain this in docs how the heck this works.
import os
import json
@@ -12,16 +14,18 @@ import traceback
from textwrap import dedent
from time import sleep, time
from pathlib import Path
-from typing import Optional
+from typing import List, Optional, Tuple
from urllib.request import Request, urlopen, urlretrieve
-URL = "https://api.cirrus-ci.com/graphql"
-TASKS = [
- ("freebsd_12_3_build", "bottom_x86_64-unknown-freebsd-13-2.tar.gz"),
- ("freebsd_13_1_build", "bottom_x86_64-unknown-freebsd-14-0.tar.gz"),
+# Form of each task is (TASK_ALIAS, FILE_NAME).
+TASKS: List[Tuple[str, str]] = [
+ ("freebsd_13_2_build", "bottom_x86_64-unknown-freebsd-13-2.tar.gz"),
+ ("freebsd_14_0_build", "bottom_x86_64-unknown-freebsd-14-0.tar.gz"),
("macos_build", "bottom_aarch64-apple-darwin.tar.gz"),
+ ("linux_2_17_build", "bottom_x86_64-unknown-linux-gnu-2-17.tar.gz"),
]
+URL = "https://api.cirrus-ci.com/graphql"
DL_URL_TEMPLATE = "https://api.cirrus-ci.com/v1/artifact/build/%s/%s/binaries/%s"
@@ -104,7 +108,7 @@ def check_build_status(key: str, id: str) -> Optional[str]:
def try_download(build_id: str, dl_path: Path):
for task, file in TASKS:
url = DL_URL_TEMPLATE % (build_id, task, file)
- out = dl_path / file
+ out = os.path.join(dl_path, file)
print("Downloading {} to {}".format(file, out))
urlretrieve(url, out)