pulumi/scripts/publish_packages.sh
Matt Ellis e56cefa285 Publish SDK binaries with same filename format as NPM packages
With this change, you can now use the `dev` tag of `@pulumi/pulumi` to
get the latest version of the SDK and install it from get.pulumi.com

This is helpful for some of our internal testing.
2018-11-21 14:38:24 -08:00

34 lines
1 KiB
Bash
Executable file

#!/bin/bash
# publish_packages.sh uploads our packages to package repositories like npm
set -o nounset
set -o errexit
set -o pipefail
readonly 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.
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 \
-u pulumi -p "${PYPI_PASSWORD}" \
"${ROOT}/sdk/python/env/src/dist"/*.whl
fi
NPM_VERSION=$("${ROOT}/scripts/get-version")
"${ROOT}/scripts/build-sdk.sh" $(echo ${NPM_VERSION} | sed -e 's/\+.*//g') $(git rev-parse HEAD)
exit 0