Skip to content

Commit 90813b3

Browse files
authored
build: use the same timestamp for release versions (#11069)
1 parent cc43dad commit 90813b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/actions/src/releasePackages/generateReleaseTree.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ async function getReleaseEntries(dev: boolean, dry: boolean) {
4343
await $`pnpm list --recursive --only-projects --filter {packages/\*} --prod --json`.json();
4444

4545
const commitHash = (await $`git rev-parse --short HEAD`.text()).trim();
46+
const timestamp = Math.round(Date.now() / 1_000);
4647

4748
for (const pkg of packageList) {
4849
// Don't release private packages ever (npm will error anyways)
@@ -71,9 +72,9 @@ async function getReleaseEntries(dev: boolean, dry: boolean) {
7172
release.version = devVersion;
7273
} else if (dry) {
7374
info(`[DRY] Bumping ${pkg.name} via git-cliff.`);
74-
release.version = `${pkg.version}.DRY-dev.${Math.round(Date.now() / 1_000)}-${commitHash}`;
75+
release.version = `${pkg.version}.DRY-dev.${timestamp}-${commitHash}`;
7576
} else {
76-
await $`pnpm --filter=${pkg.name} run release --preid "dev.${Math.round(Date.now() / 1_000)}-${commitHash}" --skip-changelog`;
77+
await $`pnpm --filter=${pkg.name} run release --preid "dev.${timestamp}-${commitHash}" --skip-changelog`;
7778
// Read again instead of parsing the output to be sure we're matching when checking against npm
7879
const pkgJson = (await file(`${pkg.path}/package.json`).json()) as PackageJSON;
7980
release.version = pkgJson.version;

0 commit comments

Comments
 (0)