build: replace the old publish script with a new bazel-based one

This commit is contained in:
Igor Minar 2018-05-10 23:01:22 -07:00
parent 5e307d5ba7
commit 4ecae6449e
2 changed files with 18 additions and 6 deletions

View File

@ -1,6 +0,0 @@
#!/usr/bin/env bash
# Use for PATCH releases
# Publish all packages in `dist/packages-dist` to npm
(cd dist/packages-dist; for p in `ls .`; do npm publish --access public $p; done)

18
scripts/release/publish-latest Executable file
View File

@ -0,0 +1,18 @@
#!/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)
# query for all npm packages to be released as part of the framework release
NPM_PACKAGE_LABELS=`bazel query --output=label 'attr("tags", "\[.*release-with-framework.*\]", //packages/...) intersect kind(".*_package", //packages/...)'`
# build all npm packages in parallel
bazel build $NPM_PACKAGE_LABELS
# 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"
bazel run -- ${packageLabel}.publish --access public --tag latest
done