publish_release.py: check number of cpus (#107)

This commit is contained in:
Sam Darwin
2025-12-18 10:48:34 -07:00
committed by GitHub
parent 40a1dbe5ca
commit c43492de26
2 changed files with 19 additions and 0 deletions

0
0 Normal file
View File

View File

@@ -306,6 +306,25 @@ def git_tags():
def preflight():
load_dotenv()
result = subprocess.run("nproc", shell=True, text=True, capture_output=True)
if result.stdout:
cpus = int(result.stdout.strip())
else:
cpus = 0
if cpus > 0 and cpus < 3:
print(
f"The number of cpus detected was {cpus}. It is recommended\
to resize this machine."
)
print(
"admin-server.boost.cpp.al may be resized by going to the release-tools\
GitHub Actions page and manually triggering 'Resize Deployment Server'."
)
answer = input("Do you want to continue: [y/n]")
if not answer or answer[0].lower() != "y":
print("Exiting.")
exit(1)
print(
"Testing /etc/mime.types. The file should exist and contain hpp, but please ensure it's a full copy from Linux."
)