2020-11-05 19:44:19 +02:00
|
|
|
const { execCommand, githubRelease, rootDir } = require('./tool-utils.js');
|
2018-02-04 19:42:33 +02:00
|
|
|
|
2020-11-05 18:58:23 +02:00
|
|
|
const appDir = `${rootDir}/packages/app-desktop`;
|
2018-02-04 19:42:33 +02:00
|
|
|
|
|
|
|
async function main() {
|
2019-01-12 00:07:23 +02:00
|
|
|
const argv = require('yargs').argv;
|
|
|
|
|
2018-02-04 19:42:33 +02:00
|
|
|
process.chdir(appDir);
|
|
|
|
|
2019-09-19 23:51:18 +02:00
|
|
|
console.info(`Running from: ${process.cwd()}`);
|
2018-02-04 19:42:33 +02:00
|
|
|
|
2018-03-09 22:59:12 +02:00
|
|
|
const version = (await execCommand('npm version patch')).trim();
|
2018-02-04 19:42:33 +02:00
|
|
|
const tagName = version;
|
|
|
|
|
2019-09-19 23:51:18 +02:00
|
|
|
console.info(`New version number: ${version}`);
|
2018-02-04 19:42:33 +02:00
|
|
|
|
2018-03-09 22:59:12 +02:00
|
|
|
console.info(await execCommand('git add -A'));
|
2020-11-18 12:36:19 +02:00
|
|
|
console.info(await execCommand(`git commit -m "Desktop release ${version}"`));
|
2019-09-19 23:51:18 +02:00
|
|
|
console.info(await execCommand(`git tag ${tagName}`));
|
2018-03-09 22:59:12 +02:00
|
|
|
console.info(await execCommand('git push && git push --tags'));
|
2018-02-04 19:42:33 +02:00
|
|
|
|
2019-01-12 00:07:23 +02:00
|
|
|
const releaseOptions = { isDraft: true, isPreRelease: !!argv.beta };
|
|
|
|
|
2019-01-12 01:40:05 +02:00
|
|
|
console.info('Release options: ', releaseOptions);
|
2019-01-12 00:07:23 +02:00
|
|
|
|
|
|
|
const release = await githubRelease('joplin', tagName, releaseOptions);
|
2018-02-04 19:42:33 +02:00
|
|
|
|
2019-09-19 23:51:18 +02:00
|
|
|
console.info(`Created GitHub release: ${release.html_url}`);
|
2020-06-06 17:04:47 +02:00
|
|
|
console.info('GitHub release page: https://github.com/laurent22/joplin/releases');
|
2020-11-05 19:18:38 +02:00
|
|
|
console.info(`To create changelog: node packages/tools/git-changelog.js ${version}`);
|
2018-02-04 19:42:33 +02:00
|
|
|
}
|
|
|
|
|
2018-03-09 22:59:12 +02:00
|
|
|
main().catch((error) => {
|
|
|
|
console.error('Fatal error');
|
2018-02-04 19:42:33 +02:00
|
|
|
console.error(error);
|
2018-03-23 19:32:29 +02:00
|
|
|
process.exit(1);
|
2019-07-30 09:35:42 +02:00
|
|
|
});
|