1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00
joplin/packages/tools/release-server.ts

26 lines
887 B
TypeScript
Raw Normal View History

import { execCommand2, rootDir, gitPullTry, completeReleaseWithChangelog } from './tool-utils';
2021-01-04 17:01:45 +02:00
const serverDir = `${rootDir}/packages/server`;
async function main() {
2021-05-14 17:17:02 +02:00
const argv = require('yargs').argv;
if (!['release', 'prerelease'].includes(argv.type)) throw new Error('Must specify release type. Either --type=release or --type=prerelease');
const isPreRelease = argv.type === 'prerelease';
2021-01-04 17:01:45 +02:00
await gitPullTry();
process.chdir(serverDir);
const version = (await execCommand2('npm version patch')).trim();
const versionSuffix = isPreRelease ? '-beta' : '';
const tagName = `server-${version}${versionSuffix}`;
2021-01-04 17:01:45 +02:00
const changelogPath = `${rootDir}/readme/changelog_server.md`;
2021-05-14 17:17:02 +02:00
await completeReleaseWithChangelog(changelogPath, version, tagName, 'Server', isPreRelease);
2021-01-04 17:01:45 +02:00
}
main().catch((error) => {
console.error('Fatal error');
console.error(error);
process.exit(1);
});