Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: use changelog to determine new version
  • Loading branch information
codebytere committed Mar 11, 2020
commit 6cda82a2bf856073c6927375976836379ef6c3a3
20 changes: 6 additions & 14 deletions lib/prepare_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,11 @@ class ReleasePreparation {
patch: semver.patch(lastTagVersion)
};

const raw = this.getBranchDiff({
onlyNotableChanges: false,
comparisonBranch: `v${lastTagVersion}`
});
const changelog = this.getChangelog();

if (raw.includes('SEMVER-MAJOR')) {
if (changelog.includes('SEMVER-MAJOR')) {
newVersion = `${lastTag.major + 1}.0.0`;
} else if (raw.includes('SEMVER-MINOR')) {
} else if (changelog.includes('SEMVER-MINOR')) {
newVersion = `${lastTag.major}.${lastTag.minor + 1}.0`;
} else {
newVersion = `${lastTag.major}.${lastTag.minor}.${lastTag.patch + 1}`;
Expand Down Expand Up @@ -431,11 +428,11 @@ class ReleasePreparation {
branchDiffOptions = [
`${upstream}/${releaseBranch}`,
proposalBranch,
`--require-label=${notableLabels.join(',')}`,
`--require-label=${notableLabels.join(',')}`
];

if (opts.simple) {
branchDiffOptions.push('--simple')
branchDiffOptions.push('--simple');
}
} else {
const excludeLabels = [
Expand All @@ -451,15 +448,10 @@ class ReleasePreparation {
excludeLabels.push('semver-minor');
}

let comparisonBranch = 'master';
if (opts.comparisonBranch) {
comparisonBranch = opts.comparisonBranch;
}

branchDiffOptions = [
stagingBranch,
// TODO(codebytere): use Current branch instead of master for LTS
comparisonBranch,
'master',
`--exclude-label=${excludeLabels.join(',')}`,
'--filter-release'
];
Expand Down