Skip to content

Commit

Permalink
publish canonicals
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Jun 17, 2024
1 parent 9b4999e commit de1f77d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"React 18",
"React 19",
"Ultra Lite",
"React Global Store",
"React18 Global Store",
"Next.js",
"Next.js 14",
"Next.js 15",
Expand Down
50 changes: 25 additions & 25 deletions scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,37 @@ try {
} catch {
// empty
}
try {
execSync("pnpm changeset version");
execSync(
`git add . && git commit -m "Apply changesets and update CHANGELOG" && git push origin ${process.env.BRANCH}`,
);
} catch {
// no changesets to be applied
}
// try {
// execSync("pnpm changeset version");
// execSync(
// `git add . && git commit -m "Apply changesets and update CHANGELOG" && git push origin ${process.env.BRANCH}`,
// );
// } catch {
// // no changesets to be applied
// }

const { version: VERSION, name } = require("../lib/package.json");
let LATEST_VERSION = "0.0.-1";
// const { version: VERSION, name } = require("../lib/package.json");
// let LATEST_VERSION = "0.0.-1";

try {
LATEST_VERSION = execSync(`npm view ${name} version`).toString() ?? "0.0.-1";
} catch {
// empty
}
// try {
// LATEST_VERSION = execSync(`npm view ${name} version`).toString() ?? "0.0.-1";
// } catch {
// // empty
// }

console.log({ VERSION, LATEST_VERSION });
// console.log({ VERSION, LATEST_VERSION });

const [newMajor, newMinor] = VERSION.split(".");
const [oldMajor, oldMinor] = LATEST_VERSION.split(".");
// const [newMajor, newMinor] = VERSION.split(".");
// const [oldMajor, oldMinor] = LATEST_VERSION.split(".");

const isPatch = newMajor === oldMajor && newMinor === oldMinor;
// const isPatch = newMajor === oldMajor && newMinor === oldMinor;

if (!isPatch) {
require("./update-security-md")(`${newMajor}.${newMinor}`, `${oldMajor}.${oldMinor}`);
/** Create new release branch for every Major or Minor release */
const releaseBranch = `release-${newMajor}.${newMinor}`;
execSync(`git checkout -b ${releaseBranch} && git push origin ${releaseBranch}`);
}
// if (!isPatch) {
// require("./update-security-md")(`${newMajor}.${newMinor}`, `${oldMajor}.${oldMinor}`);
// /** Create new release branch for every Major or Minor release */
// const releaseBranch = `release-${newMajor}.${newMinor}`;
// execSync(`git checkout -b ${releaseBranch} && git push origin ${releaseBranch}`);
// }

/** Create release */
execSync("cd lib && pnpm build");
Expand Down

0 comments on commit de1f77d

Please sign in to comment.