pulumi/scripts/publish_packages.sh

28 lines
946 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_OS_NAME:-}" == "linux" ]]; 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-03-07 20:57:38 +01:00
--repository-url https://pypi.pulumi.com?token=${PULUMI_API_TOKEN} \
-u pulumi -p pulumi \
2018-03-10 00:27:16 +01:00
${ROOT}/sdk/python/env/src/dist/*.whl
fi