Skip to content

Commit

Permalink
build: continue publishing @angular/bazel snapshot builds (angular#…
Browse files Browse the repository at this point in the history
…49583)

We are no longer publishing Angular Bazel to npm, but we are still
using it in the components repo. We should still publish it to
benefit from e.g. the APF v16 changes.

PR Close angular#49583
  • Loading branch information
devversion authored and atscott committed Mar 24, 2023
1 parent 9400b0f commit 71def16
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions scripts/build/package-builder.mts
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,32 @@ export function performNpmReleaseBuild(): BuiltPackage[] {
* Git HEAD SHA is included in the version (for easier debugging and back tracing).
*/
export function performDefaultSnapshotBuild(): BuiltPackage[] {
return buildReleasePackages(defaultDistPath, /* isSnapshotBuild */ true);
return buildReleasePackages(defaultDistPath, /* isSnapshotBuild */ true, [
// For snapshot builds, the Bazel package is still built. We want to have
// GitHub snapshot builds for it.
'//packages/bazel:npm_package',
]);
}

/**
* Builds the release packages with the given compile mode and copies
* the package output into the given directory.
*/
function buildReleasePackages(distPath: string, isSnapshotBuild: boolean): BuiltPackage[] {
function buildReleasePackages(
distPath: string,
isSnapshotBuild: boolean,
additionalTargets: string[] = []
): BuiltPackage[] {
console.info('######################################');
console.info(' Building release packages...');
console.info('######################################');

// List of targets to build. e.g. "packages/core:npm_package", or "packages/forms:npm_package".
const targets = exec(queryPackagesCmd, true).split(/\r?\n/);
const targets = exec(queryPackagesCmd, true).split(/\r?\n/).concat(additionalTargets);
const packageNames = getPackageNamesOfTargets(targets);
const bazelBinPath = exec(`${bazelCmd} info bazel-bin`, true);
const getBazelOutputPath = (pkgName: string) => join(bazelBinPath, 'packages', pkgName, 'npm_package');
const getBazelOutputPath = (pkgName: string) =>
join(bazelBinPath, 'packages', pkgName, 'npm_package');
const getDistPath = (pkgName: string) => join(distPath, pkgName);

// Build with "--config=release" or `--config=snapshot-build` so that Bazel
Expand Down

0 comments on commit 71def16

Please sign in to comment.