diff --git a/ci/cloudbuild_pypi.yaml b/ci/cloudbuild_pypi.yaml index 7b487e577..5ac72d4aa 100644 --- a/ci/cloudbuild_pypi.yaml +++ b/ci/cloudbuild_pypi.yaml @@ -23,8 +23,8 @@ steps: - 'TWINE_PASSWORD=${_TWINE_PASSWORD}' - 'TWINE_REPOSITORY_URL=${_TWINE_REPOSITORY_URL}' substitutions: - _TWINE_USERNAME: username - _TWINE_PASSWORD: password + _TWINE_USERNAME: __token__ + _TWINE_PASSWORD: _TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/ options: substitution_option: 'ALLOW_LOOSE' diff --git a/ci/release_pypi.sh b/ci/release_pypi.sh index 48aa3a346..18475d137 100644 --- a/ci/release_pypi.sh +++ b/ci/release_pypi.sh @@ -13,6 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. + +if [ "${TWINE_PASSWORD}" == "" ] +then + TWINE_PASSWORD=$(gcloud secrets versions access latest --secret="data-validation" --project=${PROJECT_ID}) +fi + python3 -m pip install --upgrade build setuptools twine wheel python3 -m build python3 -m twine upload dist/*