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

Release 2.7.0 #128

Closed
wants to merge 6 commits into from
Closed
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oat-sa/tao-extension-release",
"version": "2.6.0",
"version": "2.7.0",
"description": "Helps you to release TAO extensions",
"engines": {
"node": ">=14.0.0"
Expand Down
6 changes: 4 additions & 2 deletions src/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,11 +767,13 @@ export default function taoExtensionReleaseFactory(params = {}) {
} else {
//from conventional commits which change files in this package
const { version, recommendation } = await conventionalCommits.getNextVersion(packageInfo.lastVersion, packageInfo.packagePath);
packageInfo.recommendation = recommendation;
if (recommendation.stats && recommendation.stats.commits === 0) {
packageInfo.noChanges = true;
packageInfo.version = packageInfo.lastVersion;
} else {
packageInfo.version = version;
}
packageInfo.recommendation = recommendation;
packageInfo.version = version;
}
}

Expand Down
24 changes: 19 additions & 5 deletions src/release/packageApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ export default function packageApiFactory(params = {}, data) {
},

/**
* Checkout master, show a prompt and then run `npm publish`
* TODO: checkout latest tag?
* @returns {Promise}
* Checkout master,
* Prompt user whether he wants to publish packages
* @returns {Promise<Boolean>}
*/
async publish() {
async beforePublish() {
if (this.gitClient) {
await this.gitClient.checkout(params.releaseBranch);
}
Expand All @@ -113,6 +113,16 @@ export default function packageApiFactory(params = {}, data) {
});
publishPackage = confirmPublish;
}
return publishPackage;
},

/**
* Checkout master, show a prompt and then run `npm publish`
* TODO: checkout latest tag?
* @returns {Promise}
*/
async publish() {
const publishPackage = await this.beforePublish();
if (publishPackage) {
log.doing(`Publishing package ${this.npmPackage.name} @ ${this.npmPackage.version}`);
return this.npmPackage.publish();
Expand Down Expand Up @@ -153,7 +163,11 @@ export default function packageApiFactory(params = {}, data) {
* @returns {Promise<void>}
*/
async monorepoPublish() {
await this.npmPackage.lernaPublish();
const publishPackage = await this.beforePublish();
if (publishPackage) {
log.doing('Publishing monorepo packages');
return this.npmPackage.lernaPublish();
}
}
};
}
Loading