Skip to content

rename prepare to build, so build is not triggered after yarn install #1592

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

Merged
merged 3 commits into from
Mar 12, 2019
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ before_install:

before_script:
- cp config/ci.config.json config/project.json
- yarn build

# Misc Addons/Configs
dist: trusty
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"scripts": {
"dev": "lerna run --parallel --scope @firebase/* --scope firebase --scope rxfire dev",
"prepare": "lerna run --scope @firebase/* --scope firebase --scope rxfire prepare",
"build": "lerna run --scope @firebase/* --scope firebase --scope rxfire prepare",
"prepush": "node tools/gitHooks/prepush.js",
"link:packages": "lerna exec --scope @firebase/* --scope firebase --scope rxfire -- yarn link",
"stage:packages": "./scripts/prepublish.sh",
Expand Down
16 changes: 10 additions & 6 deletions scripts/release/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,15 @@ const {
getCurrentSha,
hasDiff,
pushUpdatesToGithub,
resetWorkingTree,
treeAtHead
resetWorkingTree
} = require('./utils/git');
const {
packageVersionUpdate,
releaseType: releaseTypePrompt,
validateReadyToPush,
validateVersions
} = require('./utils/inquirer');
const { reinstallDeps } = require('./utils/yarn');
const { reinstallDeps, buildPackages } = require('./utils/yarn');
const { runTests, setupTestDeps } = require('./utils/tests');
const { publishToNpm } = require('./utils/npm');
const { bannerText } = require('./utils/banner');
Expand All @@ -66,7 +65,7 @@ const { argv } = require('yargs');
* If there are no packages that have been updated
* skip the release cycle
*/
if (!await hasUpdatedPackages()) {
if (!(await hasUpdatedPackages())) {
console.log('No packages need to be updated. Exiting...');
return;
}
Expand Down Expand Up @@ -155,9 +154,9 @@ const { argv } = require('yargs');
await updateWorkspaceVersions(versions, argv.canary);

/**
* Users can pass --skipRebuild to skip the rebuild step
* Users can pass --skipReinstall to skip the installation step
*/
if (!argv.skipRebuild) {
if (!argv.skipReinstall) {
/**
* Clean install dependencies
*/
Expand All @@ -166,6 +165,11 @@ const { argv } = require('yargs');
await reinstallDeps();
}

/**
* build packages
*/
await buildPackages();

/**
* Don't do the following for canary releases:
* - Rerun tests (this is supposed to be a representation of the sha)
Expand Down
14 changes: 14 additions & 0 deletions scripts/release/utils/yarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,17 @@ exports.reinstallDeps = async () => {
throw err;
}
};

exports.buildPackages = async () => {
try {
const spinner = ora(' Building Packages').start();
await spawn('yarn', ['build'], {
cwd: root
});
spinner.stopAndPersist({
symbol: '✅'
});
} catch (err) {
throw err;
}
};