Skip to content

Commit

Permalink
automataCI: wrap Pypi login credentials inside simulation conditions
Browse files Browse the repository at this point in the history
Appearently, PyPi login credentails can fail a run. Hence, it has
to be wrapped inside the simulation conditions. Let's do this.

This patch wrap Pypi login credentials inside its simulation
conditions in automataCI/ directory.

Co-authored-by: Galyna, Cory <[email protected]>
Co-authored-by: (Holloway) Chew, Kean Ho <[email protected]>
Signed-off-by: (Holloway) Chew, Kean Ho <[email protected]>
  • Loading branch information
hollowaykeanho and corygalyna committed Sep 22, 2023
1 parent d4277a6 commit a4234c9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions automataCI/_release-pypi_unix-any.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ RELEASE::run_pypi() {
return 1
fi

OS::print_status info "checking pypi twine login credentials...\n"
PYPI::check_login
if [ $? -ne 0 ]; then
OS::print_status error "check failed - (TWINE_USERNAME|TWINE_PASSWORD).\n"
return 1
fi

# execute
OS::print_status info "releasing pypi package...\n"
if [ ! -z "$PROJECT_SIMULATE_RELEASE_REPO" ]; then
OS::print_status warning "simulating pypi package push...\n"
OS::print_status warning "simulating remove package artifact...\n"
else
OS::print_status info "checking pypi twine login credentials...\n"
PYPI::check_login
if [ $? -ne 0 ]; then
OS::print_status error "check failed (TWINE_USERNAME|TWINE_PASSWORD).\n"
return 1
fi

PYPI::release "$_target" "$PROJECT_GPG_ID" "$PROJECT_PYPI_REPO_URL"
if [ $? -ne 0 ]; then
OS::print_status error "release failed.\n"
Expand Down
14 changes: 7 additions & 7 deletions automataCI/_release-pypi_windows-any.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ function RELEASE-Run-PYPI {
return 1
}

OS-Print-Status info "checking pypi twine login credentials..."
$__process = PYPI-Check-Login
if ($__process -ne 0) {
OS-Print-Status error "check failed - (TWINE_USERNAME|TWINE_PASSWORD)."
return 1
}

# execute
OS-Print-Status info "releasing pypi package..."
if (-not ([string]::IsNullOrEmpty(${env:PROJECT_SIMULATE_RELEASE_REPO}))) {
OS-Print-Status warning "Simulating pypi package push..."
OS-Print-Status warning "Simulating remove package artifact..."
} else {
OS-Print-Status info "checking pypi twine login credentials..."
$__process = PYPI-Check-Login
if ($__process -ne 0) {
OS-Print-Status error "check failed - (TWINE_USERNAME|TWINE_PASSWORD)."
return 1
}

$__process = PYPI-Release `
"${_target}" `
"${env:PROJECT_GPG_ID}" `
Expand Down

0 comments on commit a4234c9

Please sign in to comment.