Skip to content

Commit

Permalink
fix release, pre, & post errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonz5288 committed Nov 22, 2021
1 parent 308d495 commit 1b6bc06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
docker create --user dev --name taichi_test --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix registry.taichigraphics.com/taichidev-ubuntu18.04:v0.1.1 /home/dev/unix_docker_test.sh $PY $GPU_TEST
docker cp .github/workflows/scripts/unix_docker_test.sh taichi_test:/home/dev/unix_docker_test.sh
docker cp wheel/*.whl taichi_test:/home/dev/
docker cp ./requirements_test.txt taichi_test:/home/dev/requirements_test.txt
docker start -a taichi_test
env:
PY: ${{ matrix.conda_python }}
Expand Down
22 changes: 11 additions & 11 deletions misc/upload_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@ def upload_taichi_version():
timeout=5)
response.raise_for_status()
except requests.exceptions.ConnectionError as err:
sys.exit('Updating latest version failed: No internet, ' + err)
sys.exit('Updating latest version failed: No internet, ' + err.toString())
except requests.exceptions.HTTPError as err:
sys.exit('Updating latest version failed: Server error, ' + err)
sys.exit('Updating latest version failed: Server error, ' + err.toString())
except requests.exceptions.Timeout as err:
sys.exit(
'Updating latest version failed: Time out when connecting server, '
+ err)
+ err.toString())
except requests.exceptions.RequestException as err:
sys.exit('Updating latest version failed: ' + err)
sys.exit('Updating latest version failed: ' + err.toString())
response = response.json()
print(response['message'])


def upload_artifact(is_nightly):
pwd_env = 'PROD_PWD' if is_nightly else 'NIGHT_PWD'
def upload_artifact(is_taichi):
pwd_env = 'PROD_PWD' if is_taichi else 'NIGHT_PWD'
twine_password = os.getenv(pwd_env)
if not twine_password:
sys.exit(f'Missing password env var {pwd_env}')
command = ["twine", "upload"]
if is_nightly:
command = ["python", "-m", "twine", "upload"]
if is_taichi :
command.extend(['--repository', 'testpypi'])
command.extend(
['--verbose', '-u', '__token__', '-p', twine_password, 'dist/*'])
Expand All @@ -50,7 +50,7 @@ def upload_artifact(is_nightly):


if __name__ == '__main__':
is_nightly = os.getenv('PROJECT_NAME', 'taichi') == 'taichi'
if not is_nightly:
is_taichi = os.getenv('PROJECT_NAME', 'taichi') == 'taichi'
if is_taichi :
upload_taichi_version()
upload_artifact(is_nightly)
upload_artifact(is_taichi)

0 comments on commit 1b6bc06

Please sign in to comment.