Skip to content

Commit 92aab8c

Browse files
cnbailianclaude
andauthored
fix: resolve semantic-release and publish auth issues in build workflow (#20)
* fix: resolve build errors by ensuring repterm-api is built before dependent packages - Add repterm-api build step before repterm and plugin-kubectl builds in release jobs - This ensures the dist/ directory exists before downstream packages try to import repterm-api - Fix npm auth configuration in release jobs to properly expand NPM_TOKEN environment variable - Simplify .npmrc configuration using echo instead of heredoc for consistent variable expansion Fixes the "Cannot find module 'repterm-api'" errors in build workflow. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * fix: resolve workspace protocol incompatibility with npm in semantic-release The semantic-release action uses npm (not bun) to run `npm version`, which cannot parse bun's `workspace:*` protocol in package.json dependencies. This adds a step to replace `workspace:*` with the actual semver range (e.g. `^0.1.0`) before semantic-release runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: write .npmrc to project root for bun publish authentication bun publish may not reliably read ~/.npmrc for authentication. Writing the .npmrc to the project root directory ensures bun can find it during publish steps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent f43a40e commit 92aab8c

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ jobs:
112112
- name: Build repterm package
113113
run: bun run build:repterm
114114

115+
- name: Resolve workspace protocol for npm compatibility
116+
run: |
117+
API_VERSION=$(jq -r .version packages/plugin-api/package.json)
118+
sed -i "s/\"workspace:\*\"/\"^${API_VERSION}\"/g" packages/repterm/package.json
119+
115120
- name: Setup Node.js
116121
uses: actions/setup-node@v4
117122
with:
@@ -227,7 +232,7 @@ jobs:
227232
run: bun install --frozen-lockfile
228233

229234
- name: Configure npm auth
230-
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
235+
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
231236
env:
232237
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
233238

@@ -239,8 +244,6 @@ jobs:
239244

240245
- name: Publish plugin package
241246
run: bun run publish:plugin-kubectl
242-
env:
243-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
244247

245248
release-repterm-api:
246249
name: Release repterm-api
@@ -260,7 +263,7 @@ jobs:
260263
run: bun install --frozen-lockfile
261264

262265
- name: Configure npm auth
263-
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
266+
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
264267
env:
265268
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
266269

@@ -269,5 +272,3 @@ jobs:
269272

270273
- name: Publish repterm-api package
271274
run: bun run publish:plugin-api
272-
env:
273-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)