diff --git a/package.json b/package.json index 1a1cfa7e8b..af5c7b41c9 100644 --- a/package.json +++ b/package.json @@ -199,7 +199,6 @@ "flush-promises": "^1.0.2", "glob": "^8.0.3", "husky": "^7.0.4", - "inquirer": "^8.0.0", "jest": "29.4.3", "jest-canvas-mock": "^2.3.1", "jest-environment-jsdom": "^29.4.1", diff --git a/scripts/make-release.js b/scripts/make-release.js deleted file mode 100644 index 6b6a03f37e..0000000000 --- a/scripts/make-release.js +++ /dev/null @@ -1,82 +0,0 @@ -const { execSync } = require('child_process'); -const inquirer = require('inquirer'); - -const getTags = (take) => { - const tags = execSync( - "git for-each-ref --sort=taggerdate --format '%(refname)' refs/tags" - ) - .toString() - .trim() - .split('\n') - .map((t) => t.replace('refs/tags/', '')) - .reverse() - .slice(0, take); - return tags; -}; - -const getReleaseBranches = () => { - const branches = execSync('git branch --remote | grep origin/release/') - .toString() - .trim() - .split('\n') - .map((b) => b.trim().replace('origin/release/', '')); - return branches; -}; - -const release = (tag, branch) => { - const steps = [ - `git checkout ${branch}`, - 'git pull', - `git reset --hard ${tag}`, - 'git push --force', - ]; - try { - for (const cmd of steps) { - const result = execSync(cmd).toString(); - } - } catch (err) { - console.error('Could not make a release'); - } -}; - -inquirer - .prompt([ - { - type: 'list', - name: 'tag', - message: 'What version would you like to release?', - choices: getTags(), - }, - { - type: 'checkbox', - name: 'envs', - message: 'To what environment you wish to release?', - choices: ['mainnet', ...getReleaseBranches()], - validate(answer) { - return answer.length > 0; - }, - }, - ]) - .then((answers) => { - inquirer - .prompt({ - type: 'confirm', - name: 'sure', - message: `Are you sure? This will release ${ - answers.tag - } to ${answers.envs.join(', ')}`, - }) - .then(() => { - for (const env of answers.envs) { - const branch = env === 'mainnet' ? 'main' : `release/${env}`; - release(answers.tag, branch); - } - execSync('git checkout develop'); - }) - .catch((err) => { - console.log('Something went wrong', err.toString()); - }); - }) - .catch((err) => { - console.log('Something went wrong', err.toString()); - });