From f749dc5529bba8cfca56d11b00641ec5ce1814f5 Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Fri, 27 May 2022 14:19:44 -0700 Subject: [PATCH 1/2] Add git tags during publish --- scripts/release/release.ts | 5 ++--- scripts/release/utils/publish.ts | 13 +++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/release/release.ts b/scripts/release/release.ts index 08d776fee3b..40495826515 100644 --- a/scripts/release/release.ts +++ b/scripts/release/release.ts @@ -180,12 +180,11 @@ export async function runRelease({ } /** - * Changeset creates tags for staging releases as well, - * but we should only push tags to Github for prod releases + * Push tags to Github for prod releases only. */ if (releaseType === ReleaseType.Production && !dryRun) { /** - * Push release tags created by changeset in publish() to Github + * Push release tags created by changeset or publishInCI() to Github */ await pushReleaseTagsToGithub(); } diff --git a/scripts/release/utils/publish.ts b/scripts/release/utils/publish.ts index 26b649eddc0..c0b27faf99e 100644 --- a/scripts/release/utils/publish.ts +++ b/scripts/release/utils/publish.ts @@ -43,6 +43,7 @@ export async function publishInCI( dryRun: boolean ) { const taskArray = []; + const tags = []; for (const pkg of updatedPkgs) { const path = await mapPkgNameToPkgPath(pkg); @@ -79,8 +80,10 @@ export async function publishInCI( continue; } + const tag = `${pkg}@${version}`; + tags.push(tag); taskArray.push({ - title: `📦 ${pkg}@${version}`, + title: `📦 ${tag}`, task: () => publishPackageInCI(pkg, npmTag, dryRun) }); } @@ -91,7 +94,13 @@ export async function publishInCI( }); console.log('\r\nPublishing Packages to NPM:'); - return tasks.run(); + await tasks.run(); + + // Create git tags. + for (const tag of tags) { + await exec(`git tag ${tag}`); + console.log(`Added git tag ${tag}.`); + } } async function publishPackageInCI( From cf8873816e1a634571d475999e89cffb0c63e87e Mon Sep 17 00:00:00 2001 From: Christina Holland Date: Tue, 31 May 2022 10:27:26 -0700 Subject: [PATCH 2/2] format --- scripts/release/utils/publish.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release/utils/publish.ts b/scripts/release/utils/publish.ts index c0b27faf99e..2ff00b2a104 100644 --- a/scripts/release/utils/publish.ts +++ b/scripts/release/utils/publish.ts @@ -95,7 +95,7 @@ export async function publishInCI( console.log('\r\nPublishing Packages to NPM:'); await tasks.run(); - + // Create git tags. for (const tag of tags) { await exec(`git tag ${tag}`);