Skip to content

Commit

Permalink
update action script
Browse files Browse the repository at this point in the history
  • Loading branch information
Niraj-Kamdar committed Jun 16, 2020
1 parent 54e3982 commit 9063e17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
12 changes: 10 additions & 2 deletions entrypoint.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import os
import subprocess
import logging

if not (os.getenv("TWINE_USERNAME") and os.getenv("TWINE_PASSWORD")):
raise EnvironmentError("You have to set your TWINE_USERNAME and TWINE_PASSWORD as environment variable")

versions = {"3.6": "cp36-cp36m", "3.7": "cp37-cp37m", "3.8": "cp38-cp38", "3.9": "cp39-cp39"}
for version in versions:
print(f"Building wheel for Python {version}")
logging.info(f"Building wheel for Python {version}")
subprocess.call([f"/opt/python/{versions[version]}/bin/python", "setup.py", "bdist_wheel"])

print("Repairing wheels")
logging.info("Repairing wheels")
for file in os.listdir("dist"):
if os.path.isfile(os.path.join(os.getcwd(), "dist", file)):
subprocess.call(["auditwheel", "repair", os.path.join(os.getcwd(), "dist", file)])


logging.info("Uploading built binary to PyPI")
subprocess.call(["twine", "upload", "wheelhouse/*"])

0 comments on commit 9063e17

Please sign in to comment.