Skip to content

Commit

Permalink
tag before release
Browse files Browse the repository at this point in the history
  • Loading branch information
mienaiyami committed Jan 20, 2023
1 parent 5839f5e commit df76f95
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
20 changes: 18 additions & 2 deletions makeAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ const printProcessing = (string) => {
// console.log(`\x1b[31m${string} \x1b[0m`)
}
console.log("\x1b[91mMake sure to edit changelog.md before pushing.\x1b[0m")

const makeAndPushTag = () => {

const a = printProcessing(`Tagging v${pkgJSON.version} and pushing tags`)
const gitSpawn = exec(`git tag -a v${pkgJSON.version} -m"v${pkgJSON.version}"`);
gitSpawn.stderr.on('data', (data) => {
process.stdout.write(`\x1b[91m${data}\x1b[0m`)
});
gitSpawn.on('close', (code) => {
clearInterval(a);
console.log(`spawn yarn child process exited with code ${code}.`);
pushRelease();
})

}

const pushRelease = () => {
const pushCommand = (`gh release create v${pkgJSON.version} -t v${pkgJSON.version} -F changelog.md ` +
// `--discussion-category "General" ` +
Expand All @@ -36,7 +52,7 @@ const pushRelease = () => {
clearInterval(a);
console.log(`spawn yarn child process exited with code ${code}.`);
if (code === 0) {
console.log("\xb1[92mPushed release to github. https://github.com/mienaiyami/react-ts-offline-manga-reader/releases\x1b[0m");
console.log("\x1b[92mPushed release to github. https://github.com/mienaiyami/react-ts-offline-manga-reader/releases.\x1b[0m");

const gitSpawn = exec("git push origin");
gitSpawn.stderr.on('data', (data) => {
Expand Down Expand Up @@ -108,7 +124,7 @@ const makeZip = () => {
const isPortable = false;
export default isPortable;
`)
pushRelease();
makeAndPushTag();
})
} else {
console.log("\x1b[91m.zip not found\x1b[0m")
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"makeExe": "electron-forge make --arch=ia32",
"makeZip": "electron-forge make --targets=@electron-forge/maker-zip --arch=ia32",
"makeAll": "npm run makeExe && npm run makeZip",
"publish": "node makeAll.js",
"release": "electron-forge publish"
"release": "node makeAll.js"
},
"license": "MIT",
"dependencies": {
Expand Down

0 comments on commit df76f95

Please sign in to comment.