From e75417d26e9d4d5d2426c5c3604e986530430c5d Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Thu, 28 Jun 2018 22:16:15 +0100 Subject: [PATCH] Tools: Automate updating Git repo when creating new Clipper release --- Clipper/joplin-webclipper/manifest.json | 2 +- Tools/release-clipper.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Clipper/joplin-webclipper/manifest.json b/Clipper/joplin-webclipper/manifest.json index 67c9ab3dc..a5a5acca4 100644 --- a/Clipper/joplin-webclipper/manifest.json +++ b/Clipper/joplin-webclipper/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Joplin Web Clipper [DEV]", - "version": "1.0.5", + "version": "1.0.6", "description": "Capture and save web pages and screenshots from your browser to Joplin.", "homepage_url": "https://joplin.cozic.net", "icons": { diff --git a/Tools/release-clipper.js b/Tools/release-clipper.js index 7bf31a7e0..bcd834dab 100644 --- a/Tools/release-clipper.js +++ b/Tools/release-clipper.js @@ -28,10 +28,11 @@ async function updateManifestVersionNumber(manifestPath) { manifest.version = v.join('.'); console.info('New version: ' + manifest.version); await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 4)); + return manifest.version; } async function main() { - await updateManifestVersionNumber(clipperDir + '/manifest.json'); + const newVersion = await updateManifestVersionNumber(clipperDir + '/manifest.json'); console.info('Building extension...'); process.chdir(clipperDir + '/popup'); @@ -74,6 +75,13 @@ async function main() { console.info(await execCommand('7z a -tzip ' + dist.name + '.zip *')); console.info(await execCommand('mv ' + dist.name + '.zip ..')); } + + console.info(await execCommand('git pull')); + console.info(await execCommand('git add -A')); + console.info(await execCommand('git commit -m "Clipper release v' + newVersion + '"')); + console.info(await execCommand('git tag clipper-' + newVersion)); + console.info(await execCommand('git push')); + console.info(await execCommand('git push --tags')); } main().catch((error) => {