Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: lay foundation for migrating to ng-dev release tooling #22167

Merged
merged 1 commit into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ng-dev/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import {github} from './github';
import {merge} from './merge';
import {commitMessage} from './commit-message';
import {caretaker} from './caretaker';
import {release} from './release';

module.exports = {
commitMessage,
format,
github,
merge,
caretaker,
release,
};
3 changes: 2 additions & 1 deletion .ng-dev/merge.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {DevInfraMergeConfig} from '@angular/dev-infra-private/pr/merge/config';
import {getDefaultTargetLabelConfiguration} from '@angular/dev-infra-private/pr/merge/defaults';
import {github} from './github';
import {release} from './release';

/**
* Configuration for the merge tool in `ng-dev`. This sets up the labels which
Expand All @@ -22,6 +23,6 @@ export const merge: DevInfraMergeConfig['merge'] = async api => {
mergeReadyLabel: 'merge ready',
commitMessageFixupLabel: 'commit message fixup',
caretakerNoteLabel: 'caretaker note',
labels: await getDefaultTargetLabelConfiguration(api, github, '@angular/cdk'),
labels: await getDefaultTargetLabelConfiguration(api, github, release),
};
};
20 changes: 20 additions & 0 deletions .ng-dev/release.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {join} from 'path';
import {ReleaseConfig} from '@angular/dev-infra-private/release/config';
import {releasePackages} from '../tools/release/release-output/release-packages';
import {promptAndGenerateChangelog} from '../tools/release/changelog';

/** Configuration for the `ng-dev release` command. */
export const release: ReleaseConfig = {
publishRegistry: 'https://wombat-dressing-room.appspot.com',
npmPackages: releasePackages.map(pkg => `@angular/${pkg}`),
buildPackages: async () => {
// The performNpmReleaseBuild function is loaded at runtime as the loading the script causes an
// invocation of bazel.
const {performNpmReleaseBuild} = require(join(__dirname, '../scripts/build-packages-dist'));
return performNpmReleaseBuild();
},
// TODO: This can be removed once there is an org-wide tool for changelog generation.
generateReleaseNotesForHead: async () => {
await promptAndGenerateChangelog(join(__dirname, '../CHANGELOG.md'));
},
};
12 changes: 10 additions & 2 deletions scripts/build-packages-dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ if (module === require.main) {

/** Builds the release packages for NPM. */
function performNpmReleaseBuild() {
buildReleasePackages(false, defaultDistPath, /* isSnapshotBuild */ false);
return buildReleasePackages(false, defaultDistPath, /* isSnapshotBuild */ false);
}

/**
* Builds the release packages as snapshot build. This means that the current
* Git HEAD SHA is included in the version (for easier debugging and back tracing).
*/
function performDefaultSnapshotBuild() {
buildReleasePackages(false, defaultDistPath, /* isSnapshotBuild */ true);
return buildReleasePackages(false, defaultDistPath, /* isSnapshotBuild */ true);
}

/**
Expand Down Expand Up @@ -103,6 +103,14 @@ function buildReleasePackages(useIvy, distPath, isSnapshotBuild) {
cp('-R', outputPath, targetFolder);
chmod('-R', 'u+w', targetFolder);
});

return packageNames.map(pkg => {
const outputPath = getOutputPath(pkg);
return {
name: `@angular/${pkg}`,
outputPath
}
})
}

/**
Expand Down