|
14 | 14 | # limitations under the License.
|
15 | 15 |
|
16 | 16 | set -eo pipefail
|
17 |
| -echo "Release script started" |
18 |
| - |
19 |
| -if [ "$(uname)" == "Darwin" ]; then |
20 |
| - # Mac OS |
21 |
| - PYTHON=$(PYENV_VERSION=3.9 pyenv which python) |
22 |
| - PYTHON_BIN=$(dirname ${PYTHON}) |
23 |
| - |
24 |
| - RELEASETOOL=${PYTHON_BIN}/releasetool |
25 |
| - TWINE=${PYTHON_BIN}/twine |
26 |
| - ${PYTHON} -m pip install gcp-releasetool twine --user |
27 |
| - |
28 |
| - echo "Change to code directory" |
29 |
| - REPO_ROOT=$(pwd) |
30 |
| - cd "${REPO_ROOT}" |
31 |
| - ls |
32 |
| - |
33 |
| -else |
34 |
| - # Kokoro Linux |
35 |
| - mv /keys/73713_google-cloud-pypi-token-keystore-1 /73713_google-cloud-pypi-token-keystore-1 |
36 |
| - |
37 |
| - PATH=/opt/python/cp39-cp39/bin/:$PATH |
38 |
| - PYTHON_BIN=/opt/python/cp39-cp39/bin/ |
39 |
| - RELEASETOOL=${PYTHON_BIN}/releasetool |
40 |
| - PYTHON=${PYTHON_BIN}/python |
41 |
| - TWINE=${PYTHON_BIN}/twine |
42 |
| - ${PYTHON} -m pip install gcp-releasetool twine |
43 |
| - |
44 |
| - echo "Change to code directory" |
45 |
| - REPO_ROOT=/var/code/python-crc32c/ |
46 |
| - cd "${REPO_ROOT}" |
47 |
| - ls |
48 |
| - |
49 |
| -fi |
50 |
| - |
51 |
| -echo "Download dependencies for release script" |
52 | 17 |
|
53 | 18 | # Start the releasetool reporter
|
54 |
| -${PYTHON} -m pip install --require-hashes -r ${REPO_ROOT}/.kokoro/requirements.txt |
55 |
| -${RELEASETOOL} publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script |
56 |
| - |
57 |
| -# Ensure that we have the latest versions of Twine, Wheel, and Setuptools. |
58 |
| -${PYTHON} -m pip install --upgrade twine wheel setuptools --user |
| 19 | +python3 -m pip install --require-hashes -r github/python-crc32c/.kokoro/requirements.txt |
| 20 | +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script |
59 | 21 |
|
60 | 22 | # Disable buffering, so that the logs stream through.
|
61 | 23 | export PYTHONUNBUFFERED=1
|
62 |
| -echo "## RELASE WORKFLOW SUCCESSFUL ##" |
63 |
| -echo "## Uploading Wheels ##" |
64 |
| -# TODO: ONE OF THE BELOW WORKS |
| 24 | + |
65 | 25 | # Move into the package, build the distribution and upload.
|
66 | 26 | TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1")
|
67 | 27 | cd github/python-crc32c
|
68 | 28 | python3 setup.py sdist bdist_wheel
|
69 |
| -#twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* |
70 |
| - |
71 |
| -${PYTHON} setup.py sdist |
72 |
| -# ${TWINE} upload --skip-existing --username gcloudpypi --password "${TWINE_PASSWORD}" dist/* wheels/* |
| 29 | +twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* |
0 commit comments