Skip to content

Commit

Permalink
chore: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ErKeLost committed Oct 18, 2024
1 parent ec58244 commit 93170e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions scripts/bump-nightly.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { execSync } from "child_process";

// generate nightly version
const nightlyVersion = `0.0.0-nightly.${Date.now()}`;
const dateString =
new Date().getFullYear() +
String(new Date().getMonth() + 1).padStart(2, "0") +
String(new Date().getDate()).padStart(2, "0");
const nightlyVersion = `2.0.0-nightly.${dateString}`;

execSync(`npx changeset version --snapshot nightly`, { stdio: "inherit" });
execSync(`npx changeset version --snapshot ${nightlyVersion}`, { stdio: "inherit" });

execSync("pnpm install --no-frozen-lockfile", { stdio: "inherit" });

Expand Down
8 changes: 6 additions & 2 deletions scripts/release-nightly.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { execSync } from "child_process";
import { buildCli, buildCoreCjs, buildJsPlugins } from "./build.mjs";

// Generate nightly version number
const nightlyVersion = `0.0.0-nightly.${Date.now()}`;
const dateString =
new Date().getFullYear() +
String(new Date().getMonth() + 1).padStart(2, "0") +
String(new Date().getDate()).padStart(2, "0");
const nightlyVersion = `2.0.0-nightly.${dateString}`;

// Build node packages
await buildCli();
Expand All @@ -13,7 +17,7 @@ await buildJsPlugins();
execSync("npm config set access public", { stdio: "inherit" });

// Update versions to nightly
execSync(`npx changeset version --snapshot nightly`, { stdio: "inherit" });
execSync(`npx changeset version --snapshot ${nightlyVersion}`, { stdio: "inherit" });

// Publish nightly packages
execSync("npx changeset publish --tag nightly", { stdio: "inherit" });
Expand Down

0 comments on commit 93170e0

Please sign in to comment.