Skip to content

Commit f07084f

Browse files
authored
chore: fix release process (#1670)
1 parent 83897e7 commit f07084f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,14 @@ jobs:
5555
- uses: actions/setup-node@v6
5656
with:
5757
node-version-file: '.nvmrc'
58+
59+
# Latest npm (11.6.4) supports trusted publishers and Node.js v20
60+
- name: Update npm
61+
run: npm install -g [email protected]
5862

5963
- name: Install dependencies
6064
run: npm ci --ignore-scripts
61-
65+
6266
- name: Publish the release
6367
env:
6468
DRY_RUN: "${{ inputs.dry-run }}"

scripts/ci-release.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,17 @@ async function dryRunMode() {
106106
}
107107

108108
try {
109+
// This prevent lerna command from throwing this error in dry-run mode:
110+
// "Working tree has uncommitted changes, please commit or remove the following changes before continuing"
111+
await execa(
112+
'git',
113+
['update-index', '--skip-worktree', '.npmrc']
114+
)
115+
.pipeStdout(process.stdout)
116+
.pipeStderr(process.stderr)
109117
await execa(
110118
'npx',
111-
['lerna', 'publish', 'from-package', `--registry=${registryUrl}`, '--no-push', '--no-git-tag-version', '--no-changelog', '--yes'],
119+
['lerna', 'publish', 'from-package', `--registry=${registryUrl}`, '--no-push', '--no-git-tag-version', '--no-changelog', '--yes', '--loglevel=debug'],
112120
{ stdin: process.stdin }
113121
)
114122
.pipeStdout(process.stdout)

0 commit comments

Comments
 (0)