pulumi/scripts/publish_packages.sh

29 lines
970 B
Bash
Raw Normal View History

#!/bin/bash
# publish_packages.sh uploads our packages to package repositories like npm
set -o nounset -o errexit -o pipefail
2018-03-07 04:35:56 +01:00
ROOT=$(dirname $0)/..
if [[ "${TRAVIS_PUBLISH_PACKAGES:-}" == "true" ]]; then
echo "Publishing NPM package to NPMjs.com:"
NPM_TAG="dev"
# If the package doesn't have a pre-release tag, use the tag of latest instead of
# dev. NPM uses this tag as the default version to add, so we want it to mean
# the newest released version.
2018-04-05 23:43:03 +02:00
if [[ $(jq -r .version < "${ROOT}/sdk/nodejs/bin/package.json") != *-* ]]; then
NPM_TAG="latest"
fi
pushd ${ROOT}/sdk/nodejs/bin && \
npm publish --tag "${NPM_TAG}" && \
npm info 2>/dev/null || true && \
popd
echo "Publishing Pip package to pulumi.com:"
twine upload \
2018-06-12 08:15:03 +02:00
-u pulumi -p ${PYPI_PASSWORD} \
2018-03-10 00:27:16 +01:00
${ROOT}/sdk/python/env/src/dist/*.whl
fi
${ROOT}/scripts/build-sdk.sh $(${ROOT}/scripts/get-version) $(git rev-parse HEAD)