Commit ee9e798d authored by yogevbd's avatar yogevbd

Fix realese script

parent 09dd16d6
......@@ -8,7 +8,7 @@ const path = require('path');
// Workaround JS
const isRelease = process.env.RELEASE_BUILD === 'true';
const ONLY_ON_BRANCH = 'origin/master';
const BRANCH = process.env.BRANCH;
const VERSION_TAG = isRelease ? 'latest' : 'snapshot';
const VERSION_INC = 'patch';
......@@ -31,11 +31,6 @@ function validateEnv() {
return false;
}
if (process.env.GIT_BRANCH !== ONLY_ON_BRANCH) {
console.log(`not publishing on branch ${process.env.GIT_BRANCH}`);
return false;
}
return true;
}
......@@ -121,13 +116,13 @@ function readPackageJson() {
}
function updatePackageJsonGit(version) {
exec.execSync(`git checkout master`);
exec.execSync(`git checkout ${BRANCH}`);
const packageJson = readPackageJson();
packageJson.version = version;
writePackageJson(packageJson);
exec.execSync(`git add package.json`);
exec.execSync(`git commit -m"Update package.json version to ${version} [ci skip]"`);
exec.execSync(`git push deploy master`);
exec.execSync(`git push deploy ${BRANCH}`);
}
run();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment