2018-05-11 02:01:22 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -u -e -o pipefail
|
|
|
|
|
|
|
|
# Use for BETA and RC releases
|
|
|
|
# Query Bazel for npm_package and ng_package rules with tags=["release-with-framework"]
|
|
|
|
# Publish them to npm (tagged next)
|
|
|
|
|
2018-11-01 15:47:39 -04:00
|
|
|
# We need to resolve the Bazel binary in the node modules because running Bazel
|
|
|
|
# through `yarn bazel` causes additional output that throws off the command stdout.
|
|
|
|
BAZEL_BIN=$(yarn bin)/bazel
|
|
|
|
|
2018-05-11 02:01:22 -04:00
|
|
|
# query for all npm packages to be released as part of the framework release
|
2018-11-01 15:47:39 -04:00
|
|
|
NPM_PACKAGE_LABELS=`${BAZEL_BIN} query --output=label 'attr("tags", "\[.*release-with-framework.*\]", //packages/...) intersect kind(".*_package", //packages/...)'`
|
2018-05-11 02:01:22 -04:00
|
|
|
# build all npm packages in parallel
|
2018-11-01 15:47:39 -04:00
|
|
|
${BAZEL_BIN} build $NPM_PACKAGE_LABELS
|
2018-05-11 02:01:22 -04:00
|
|
|
# publish all packages in sequence to make it easier to spot any errors or warnings
|
|
|
|
for packageLabel in $NPM_PACKAGE_LABELS; do
|
|
|
|
echo "publishing $packageLabel"
|
2018-11-01 15:47:39 -04:00
|
|
|
${BAZEL_BIN} run -- ${packageLabel}.publish --access public --tag latest
|
2018-05-11 02:01:22 -04:00
|
|
|
done
|
|
|
|
|