Skip to content

Commit 97379ca

Browse files
committed
fix(ci): publish npm package from outside pnpm workspace
1 parent a386052 commit 97379ca

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7575

7676
publish-npm:
77-
name: Publish @marionette/cli to npm
77+
name: Publish @marionette-app/cli to npm
7878
needs: create-release
7979
runs-on: ubuntu-latest
8080
steps:
@@ -87,15 +87,20 @@ jobs:
8787
node-version: 20
8888
registry-url: https://registry.npmjs.org
8989

90-
- name: Set version from tag
90+
- name: Publish to npm
9191
run: |
9292
VERSION="${{ github.ref_name }}"
9393
VERSION="${VERSION#v}"
94-
npm version "$VERSION" --no-git-tag-version
95-
working-directory: packages/cli
96-
97-
- name: Publish to npm
98-
run: npm publish --access public
99-
working-directory: packages/cli
94+
# Patch version directly to avoid npm workspace protocol errors
95+
node -e "
96+
const fs = require('fs');
97+
const pkg = JSON.parse(fs.readFileSync('packages/cli/package.json', 'utf8'));
98+
pkg.version = '$VERSION';
99+
fs.writeFileSync('packages/cli/package.json', JSON.stringify(pkg, null, 2) + '\n');
100+
"
101+
# Publish from /tmp to avoid npm picking up pnpm workspace:* deps
102+
cp -r packages/cli /tmp/marionette-cli
103+
cd /tmp/marionette-cli
104+
npm publish --access public
100105
env:
101106
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)