From 8d61e451b035397a6330edcb36ceb70fce994d8d Mon Sep 17 00:00:00 2001 From: paradoxuum Date: Sat, 20 Jul 2024 06:41:11 +0100 Subject: [PATCH] build: fetch all git history, improve publish error handling --- .github/scripts/publish.mjs | 9 +++++++-- .github/workflows/publish.yml | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/scripts/publish.mjs b/.github/scripts/publish.mjs index c7cde9c0..346ab092 100644 --- a/.github/scripts/publish.mjs +++ b/.github/scripts/publish.mjs @@ -21,6 +21,11 @@ for (const pkg of getChangedPackages(nightly)) { console.log(`Set ${pkgName} version to ${version}`); } - execSync(`yarn workspace ${pkgName} npm publish --tag ${tag}`); - console.log(`Published ${pkgName}@${tag} to npm`); + try { + execSync(`yarn workspace ${pkgName} npm publish --tag ${tag}`); + console.log(`Published ${pkgName}@${tag} to npm`); + } catch (err) { + console.error(`Failed to publish ${pkgName}@${tag} to npm`); + throw err.stdout.toString(); + } } diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 48727b77..4da383b8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,6 +20,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Enable Corepack run: corepack enable