2018-03-09 17:49:35 +00:00
|
|
|
const { execCommand, githubRelease, handleCommitHook, githubOauthToken } = require("./tool-utils.js");
|
|
|
|
const path = require("path");
|
2018-02-04 17:42:33 +00:00
|
|
|
|
|
|
|
const rootDir = path.dirname(__dirname);
|
2018-03-09 17:49:35 +00:00
|
|
|
const appDir = rootDir + "/ElectronClient/app";
|
2018-02-04 17:42:33 +00:00
|
|
|
|
|
|
|
async function main() {
|
|
|
|
const oauthToken = await githubOauthToken();
|
|
|
|
process.chdir(appDir);
|
|
|
|
|
2018-03-09 17:49:35 +00:00
|
|
|
console.info("Running from: " + process.cwd());
|
2018-02-04 17:42:33 +00:00
|
|
|
|
2018-03-09 17:49:35 +00:00
|
|
|
const version = (await execCommand("npm version patch")).trim();
|
2018-02-04 17:42:33 +00:00
|
|
|
const tagName = version;
|
|
|
|
|
2018-03-09 17:49:35 +00:00
|
|
|
console.info("New version number: " + version);
|
2018-02-04 17:42:33 +00:00
|
|
|
|
2018-03-09 17:49:35 +00:00
|
|
|
console.info(await execCommand("git add -A"));
|
2018-02-04 17:42:33 +00:00
|
|
|
console.info(await execCommand('git commit -m "Electron release ' + version + '"'));
|
2018-03-09 17:49:35 +00:00
|
|
|
console.info(await execCommand("git tag " + tagName));
|
|
|
|
console.info(await execCommand("git push && git push --tags"));
|
2018-02-04 17:42:33 +00:00
|
|
|
|
2018-03-09 17:49:35 +00:00
|
|
|
const release = await githubRelease("joplin", tagName, true);
|
2018-02-04 17:42:33 +00:00
|
|
|
|
2018-03-09 17:49:35 +00:00
|
|
|
console.info("Created GitHub release: " + release.html_url);
|
2018-02-04 17:42:33 +00:00
|
|
|
}
|
|
|
|
|
2018-03-09 17:49:35 +00:00
|
|
|
main().catch(error => {
|
|
|
|
console.error("Fatal error");
|
2018-02-04 17:42:33 +00:00
|
|
|
console.error(error);
|
2018-03-09 17:49:35 +00:00
|
|
|
});
|