-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathupload.py
37 lines (29 loc) · 893 Bytes
/
upload.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
35
36
37
import sys
from pathlib import Path
import argparse
from scripts.common import eprint, run_command_unchecked
def main() -> None:
parser = argparse.ArgumentParser(
description="Upload .conda files to a specified channel."
)
parser.add_argument(
"--channel", required=True, help="The channel to upload the .conda files to."
)
args = parser.parse_args()
exit_code = 0
for conda_file in Path("output").glob("**/*.conda"):
command = [
"rattler-build",
"upload",
"prefix",
"--channel",
args.channel,
str(conda_file),
]
result = run_command_unchecked(command)
if result.returncode != 0:
eprint(f"Error uploading {conda_file}: {result.stderr}")
exit_code = 1
sys.exit(exit_code)
if __name__ == "__main__":
main()