Skip to content

Commit

Permalink
Add --rc flag to changelog script
Browse files Browse the repository at this point in the history
The changelog script now accepts an `--rc` flag to tell it whether to
add new changes to `Unreleased` or to the header for the current
version.

Previously this was inferred from whether the current version matched
the most recent tag. However this method only works for the first
update. Using a flag simplifies this logic, and makes it possible to
manually re-run this for further updates to a release candidate.
  • Loading branch information
Gudahtt committed Apr 7, 2021
1 parent 1c5dcd6 commit a61c161
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
command: .circleci/scripts/release-bump-manifest-version.sh
- run:
name: Update changelog
command: yarn update-changelog
command: yarn update-changelog --rc
- run:
name: Commit changes
command: .circleci/scripts/release-commit-version-bump.sh
Expand Down
15 changes: 11 additions & 4 deletions development/auto-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ const runCommand = require('./lib/runCommand');
const URL = '/~https://github.com/MetaMask/metamask-extension';

async function main() {
const args = process.argv.slice(2);
let isReleaseCandidate = false;

for (const arg of args) {
if (arg === '---rc') {
isReleaseCandidate = true;
} else {
throw new Error(`Unrecognized argument: ${arg}`);
}
}

await runCommand('git', ['fetch', '--tags']);

const [mostRecentTagCommitHash] = await runCommand('git', [
Expand Down Expand Up @@ -100,10 +111,6 @@ async function main() {
return;
}

// remove the "v" prefix
const mostRecentVersion = mostRecentTag.slice(1);

const isReleaseCandidate = mostRecentVersion !== version;
const versionHeader = `## [${version}]`;
const escapedVersionHeader = escapeRegExp(versionHeader);
const currentDevelopBranchHeader = '## [Unreleased]';
Expand Down

0 comments on commit a61c161

Please sign in to comment.