-
Notifications
You must be signed in to change notification settings - Fork 1
/
update_pkgs.py
34 lines (27 loc) · 1009 Bytes
/
update_pkgs.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
28
29
30
31
32
33
34
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".github"))
from actions import main as github_action
def execute_main(pkg_name, versions, short_desc, homepage):
# Delete
os.environ["PKG_ACTION"] = "DELETE"
os.environ["PKG_NAME"] = pkg_name
github_action()
print(f"Package {pkg_name} deleted")
# Register
os.environ["PKG_ACTION"] = "REGISTER"
os.environ["PKG_NAME"] = pkg_name
os.environ["PKG_VERSION"] = versions[0]
os.environ["PKG_AUTHOR"] = "Nicolas Remond"
os.environ["PKG_SHORT_DESC"] = short_desc
os.environ["PKG_HOMEPAGE"] = homepage
github_action()
print(f"Package {pkg_name} registered")
# Update
for version in versions[1:]:
os.environ["PKG_ACTION"] = "UPDATE"
os.environ["PKG_NAME"] = pkg_name
os.environ["PKG_VERSION"] = version
github_action()
print(f"Package {pkg_name} updated to version {version}")
print(f"Package {pkg_name} done")