-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the publish script to invoke existing build command, then run the script generated by Bazel npm_package target to publish to npm.
- Loading branch information
Keen Yee Liau
committed
Feb 21, 2020
1 parent
01838b6
commit 6b4d116
Showing
4 changed files
with
23 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
|
||
#!/usr/bin/env bash | ||
|
||
set -u -e -o pipefail | ||
source $(dirname $0)/scripts/package-builder.sh | ||
|
||
readonly tag="$1" | ||
|
||
# Use for BETA and RC releases | ||
# Query Bazel for npm_package and ng_package rules | ||
# Publish them to npm (tagged next) | ||
if [[ $tag != 'latest' && $tag != 'next' ]]; then | ||
echo "Invalid tag: ${tag}. Must be either 'latest' or 'next'" | ||
exit 1 | ||
fi | ||
|
||
# query for all npm packages to be released as part of the framework release | ||
NPM_PACKAGE_LABELS=`bazel query --output=label 'attr("tags", "\[.*release.*\]", //modules/...) intersect kind(".*_package", //modules/...)'` | ||
# build all npm packages in parallel | ||
bazel build --config=release $NPM_PACKAGE_LABELS | ||
# Build the npm packages | ||
buildTargetPackages "dist/modules-dist" "legacy" "Production" | ||
|
||
# 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 --config=release -- ${packageLabel}.publish --access public --tag latest | ||
# Publish all packages to NPM | ||
for target in $(getAllPackages); do | ||
echo "==============================================" | ||
echo "Publishing ${target}" | ||
echo "==============================================" | ||
${bazel_bin} run --config=release "${target}.publish" -- \ | ||
--access public --tag "${tag}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters