mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-18 20:02:40 +08:00
build: Update publish script
Update the publish script to invoke existing build command, then run the script generated by Bazel npm_package target to publish to npm.
This commit is contained in:
parent
01838b6b0d
commit
6b4d116cce
@ -17,12 +17,12 @@ git push upstream && git push upstream --tags
|
|||||||
- Publish
|
- Publish
|
||||||
```sh
|
```sh
|
||||||
# For release with 'next' tag
|
# For release with 'next' tag
|
||||||
./publish-next.sh
|
./publish.sh next
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# For release with 'latest' tag
|
# For release with 'latest' tag
|
||||||
./publish.sh
|
./publish.sh latest
|
||||||
```
|
```
|
||||||
|
|
||||||
# Release Changelog
|
# Release Changelog
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -u -e -o pipefail
|
|
||||||
|
|
||||||
# Use for BETA and RC releases
|
|
||||||
# Query Bazel for npm_package and ng_package rules
|
|
||||||
# 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.*\]", //modules/...) intersect kind(".*_package", //modules/...)'`
|
|
||||||
# build all npm packages in parallel
|
|
||||||
bazel build --config=release $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 --config=release -- ${packageLabel}.publish --access public --tag next
|
|
||||||
done
|
|
29
publish.sh
29
publish.sh
@ -1,19 +1,22 @@
|
|||||||
|
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -u -e -o pipefail
|
source $(dirname $0)/scripts/package-builder.sh
|
||||||
|
|
||||||
# Use for BETA and RC releases
|
readonly tag="$1"
|
||||||
# Query Bazel for npm_package and ng_package rules
|
|
||||||
# Publish them to npm (tagged next)
|
|
||||||
|
|
||||||
# query for all npm packages to be released as part of the framework release
|
if [[ $tag != 'latest' && $tag != 'next' ]]; then
|
||||||
NPM_PACKAGE_LABELS=`bazel query --output=label 'attr("tags", "\[.*release.*\]", //modules/...) intersect kind(".*_package", //modules/...)'`
|
echo "Invalid tag: ${tag}. Must be either 'latest' or 'next'"
|
||||||
# build all npm packages in parallel
|
exit 1
|
||||||
bazel build --config=release $NPM_PACKAGE_LABELS
|
fi
|
||||||
|
|
||||||
# publish all packages in sequence to make it easier to spot any errors or warnings
|
# Build the npm packages
|
||||||
for packageLabel in $NPM_PACKAGE_LABELS; do
|
buildTargetPackages "dist/modules-dist" "legacy" "Production"
|
||||||
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
|
done
|
||||||
|
@ -22,9 +22,13 @@ readonly base_dir=$(pwd)/..
|
|||||||
readonly bazel_bin=$(yarn bin)/bazel
|
readonly bazel_bin=$(yarn bin)/bazel
|
||||||
readonly bin=$(${bazel_bin} info bazel-bin)
|
readonly bin=$(${bazel_bin} info bazel-bin)
|
||||||
|
|
||||||
|
function getAllPackages() {
|
||||||
|
${bazel_bin} query --output=label 'attr("tags", "\[.*release\]", //modules/...) intersect kind("pkg_npm|ng_package", //modules/...)'
|
||||||
|
}
|
||||||
|
|
||||||
function buildTargetPackages() {
|
function buildTargetPackages() {
|
||||||
# List of targets to build, e.g. core, common, compiler, etc.
|
# List of targets to build, e.g. core, common, compiler, etc.
|
||||||
targets=$(${bazel_bin} query --output=label 'attr("tags", "\[.*release\]", //modules/...) intersect kind("pkg_npm|ng_package", //modules/...)')
|
targets=$(getAllPackages)
|
||||||
|
|
||||||
# Path to the output directory into which we copy the npm packages.
|
# Path to the output directory into which we copy the npm packages.
|
||||||
dest_path="$1"
|
dest_path="$1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user