Skip to content

Commit 77d044e

Browse files
committed
fix: Generate correct npm-shrinkwrap.json
1 parent f63a6c1 commit 77d044e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

.github/workflows/release-please.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,24 @@ jobs:
6969
with:
7070
node-version: 24.x
7171

72-
73-
- name: Prepare production dependency tree
74-
working-directory: packages/cli
72+
- name: Generate npm-shrinkwrap.json (isolated staging)
7573
run: |
76-
echo "📦 Installing production dependencies for CLI"
74+
set -e
75+
echo "📦 Isolating @ui5/cli for shrinkwrap"
7776
npm ci --omit=dev
78-
- name: Generate npm-shrinkwrap.json (prod only)
79-
run: |
80-
echo "🔒 Creating npm-shrinkwrap.json without devDependencies"
81-
# Create temporary directory outside workspace for shrinkwrap generation
82-
mkdir -p /tmp/cli-shrinkwrap
83-
cp -r packages/cli/* /tmp/cli-shrinkwrap/
84-
cd /tmp/cli-shrinkwrap
85-
rm -f npm-shrinkwrap.json
86-
npm shrinkwrap
87-
# Copy shrinkwrap back to CLI package
88-
cp npm-shrinkwrap.json ${{ github.workspace }}/packages/cli/
89-
echo "✅ npm-shrinkwrap.json generated"
77+
STAGE=cli-publish
78+
rm -rf "$STAGE" && mkdir "$STAGE"
79+
echo "↪️ Copying CLI sources"
80+
rsync -a --exclude 'node_modules' packages/cli/ "$STAGE"/
81+
echo "↪️ Copying resolved production dependencies"
82+
rsync -a node_modules/ "$STAGE"/node_modules/
83+
echo "🧹 Pruning extraneous modules inside staging"
84+
(cd "$STAGE" && npm prune --production)
85+
echo "🔒 Running npm shrinkwrap in isolated directory (post-prune)"
86+
(cd "$STAGE" && npm shrinkwrap)
87+
mv "$STAGE"/npm-shrinkwrap.json packages/cli/
88+
echo "✅ npm-shrinkwrap.json placed into packages/cli"
89+
9090
- name: Publish @ui5/cli
9191
working-directory: packages/cli
9292
run: |

0 commit comments

Comments
 (0)