Skip to content

Commit 975a278

Browse files
author
strausr
committed
fix: remove invalid tarballDir config and improve npm auth setup for semantic-release
1 parent d2ad403 commit 975a278

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,26 @@ jobs:
9797
echo "=== Git tags ==="
9898
git tag
9999
100-
- name: Debug npm auth
100+
- name: Configure npm authentication for semantic-release
101101
run: |
102-
echo "=== NPM Config ==="
103-
cat ~/.npmrc 2>/dev/null || echo "No ~/.npmrc found"
104-
echo ""
105-
echo "=== NPM Token from env ==="
106-
echo "NODE_AUTH_TOKEN is set: $([ -n "$NODE_AUTH_TOKEN" ] && echo 'yes' || echo 'no')"
107-
echo ""
108-
echo "=== NPM whoami ==="
109-
npm whoami --registry=https://registry.npmjs.org || echo "npm whoami failed"
110-
echo ""
111-
echo "=== Setting NPM_TOKEN from NODE_AUTH_TOKEN for semantic-release ==="
102+
# actions/setup-node creates .npmrc in a temp location
103+
# We need to copy it or create one that semantic-release can use
104+
if [ -f "$NPM_CONFIG_USERCONFIG" ]; then
105+
echo "Found npmrc at $NPM_CONFIG_USERCONFIG"
106+
cat "$NPM_CONFIG_USERCONFIG"
107+
# Copy to home directory for semantic-release
108+
cp "$NPM_CONFIG_USERCONFIG" ~/.npmrc || true
109+
fi
110+
111+
# Also set NPM_TOKEN from NODE_AUTH_TOKEN if available
112112
if [ -n "$NODE_AUTH_TOKEN" ]; then
113113
echo "NPM_TOKEN=$NODE_AUTH_TOKEN" >> $GITHUB_ENV
114114
echo "NPM_TOKEN set from NODE_AUTH_TOKEN"
115-
else
116-
echo "Warning: NODE_AUTH_TOKEN not found"
117115
fi
116+
117+
# Test npm auth
118+
echo "=== Testing npm authentication ==="
119+
npm whoami --registry=https://registry.npmjs.org || echo "npm whoami failed (this is OK if using OIDC)"
118120
119121
- name: Release
120122
env:

.releaserc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
[
1414
"@semantic-release/npm",
1515
{
16-
"npmPublish": true,
17-
"tarballDir": false
16+
"npmPublish": true
1817
}
1918
],
2019
[

0 commit comments

Comments
 (0)