-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathappveyor.py
27 lines (22 loc) · 918 Bytes
/
appveyor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import requests
import wget, urllib, os, glob
if os.path.exists("post-0.4/0.9.0"):
for file in glob.glob(os.path.join("post-0.4/0.9.0", "pyunity*.whl")):
os.remove(file)
else:
os.mkdir("post-0.4/0.9.0")
apiUrl = "https://ci.appveyor.com/api"
project = requests.get(f"{apiUrl}/projects/pyunity/pyunity")
for job in project.json()["build"]["jobs"]:
jobId = job["jobId"]
artifacts = requests.get(f"{apiUrl}/buildjobs/{jobId}/artifacts")
for artifact in artifacts.json():
file = artifact["fileName"]
try:
wget.download(f"{apiUrl}/buildjobs/{jobId}/artifacts/{file}",
"post-0.4/0.9.0/" + os.path.basename(file))
except urllib.error.HTTPError:
print(f"Couldn't download {os.path.basename(file)}", end="")
print()
for file in glob.glob("post-0.4/0.9.0/*linux*"):
os.rename(file, file.replace("linux", "manylinux1"))