Skip to content

Commit a02d82f

Browse files
yinghsienwucopybara-github
authored andcommitted
chore: set up automatic release process for publishing vertexai package to PyPi
PiperOrigin-RevId: 656480347
1 parent 829e0f6 commit a02d82f

File tree

5 files changed

+34
-5
lines changed

5 files changed

+34
-5
lines changed

.kokoro/release.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,16 @@ python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /
2222
# Disable buffering, so that the logs stream through.
2323
export PYTHONUNBUFFERED=1
2424

25-
# Move into the package, build the distribution and upload.
26-
TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1")
25+
# Move into the `google-cloud-aiplatform` package, build the distribution and upload.
26+
GCA_TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1")
2727
cd github/python-aiplatform
2828
python3 setup.py sdist bdist_wheel
29-
twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/*
29+
twine upload --username __token__ --password "${GCA_TWINE_PASSWORD}" dist/*
30+
31+
# Move into the `vertexai` package, build the distribution and upload.
32+
VERTEXAI_TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_vertexai-pypi-token-1")
33+
cd github/python-aiplatform/pypi/_vertex_ai_placeholder
34+
python3 -m build
35+
twine upload --username __token__ --password "${VERTEXAI_TWINE_PASSWORD}" dist/*
36+
37+

.kokoro/release/common.cfg

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env_vars: {
2323
value: "github/python-aiplatform/.kokoro/release.sh"
2424
}
2525

26-
# Fetch PyPI password
26+
# Fetch google-cloud-aiplatform PyPI password
2727
before_action {
2828
fetch_keystore {
2929
keystore_resource {
@@ -33,6 +33,16 @@ before_action {
3333
}
3434
}
3535

36+
# Fetch vertexai PyPI password
37+
before_action {
38+
fetch_keystore {
39+
keystore_resource {
40+
keystore_config_id: 73713
41+
keyname: "vertexai-pypi-token-1"
42+
}
43+
}
44+
}
45+
3646
# Tokens needed to report release status back to GitHub
3747
env_vars: {
3848
key: "SECRET_MANAGER_KEYS"

.kokoro/requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ setuptools
88
nox>=2022.11.21 # required to remove dependency on py
99
charset-normalizer<3
1010
click<8.1.0
11+
build

.kokoro/requirements.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.9
2+
# This file is autogenerated by pip-compile with Python 3.11
33
# by the following command:
44
#
55
# pip-compile --allow-unsafe --generate-hashes requirements.in
@@ -12,6 +12,10 @@ attrs==23.1.0 \
1212
--hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \
1313
--hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015
1414
# via gcp-releasetool
15+
build==1.2.1 \
16+
--hash=sha256:526263f4870c26f26c433545579475377b2b7588b6f1eac76a001e873ae3e19d \
17+
--hash=sha256:75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4
18+
# via -r requirements.in
1519
cachetools==5.3.2 \
1620
--hash=sha256:086ee420196f7b2ab9ca2db2520aca326318b68fe5ba8bc4d49cca91add450f2 \
1721
--hash=sha256:861f35a13a451f94e301ce2bec7cac63e881232ccce7ed67fab9b5df4d3beaa1
@@ -373,6 +377,7 @@ packaging==23.2 \
373377
--hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \
374378
--hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7
375379
# via
380+
# build
376381
# gcp-releasetool
377382
# nox
378383
pkginfo==1.9.6 \
@@ -438,6 +443,10 @@ pyjwt==2.8.0 \
438443
pyperclip==1.8.2 \
439444
--hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57
440445
# via gcp-releasetool
446+
pyproject-hooks==1.0.0 \
447+
--hash=sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8 \
448+
--hash=sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5
449+
# via build
441450
python-dateutil==2.8.2 \
442451
--hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \
443452
--hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9

owlbot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
".kokoro/continuous/prerelease-deps.cfg",
113113
".kokoro/presubmit/prerelease-deps.cfg",
114114
".kokoro/docs/docs-presubmit.cfg",
115+
".kokoro/release.sh",
115116
# exclude sample configs so periodic samples are tested against main
116117
# instead of pypi
117118
".kokoro/samples/python3.7/common.cfg",

0 commit comments

Comments
 (0)