ci(publish-npm): pin bun version, add vite build, and ignore scripts on publish

Pin bun to 1.3.11 for reproducible builds. Add explicit vite build step before publishing. Add --ignore-scripts to npm publish for security.

Signed-off-by: 林凯90331 <90331@sangfor.com>

Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
This commit is contained in:
林凯90331 2026-05-14 21:37:15 +08:00
parent 49808bb967
commit 1e10473fb7

View File

@ -88,7 +88,7 @@ jobs:
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2, 2026-04-25
with:
bun-version: latest
bun-version: "1.3.11"
- name: Setup SSH for review agent generation
uses: webfactory/ssh-agent@v0.9.0
@ -107,15 +107,18 @@ jobs:
# - name: Run tests
# run: bun test
- name: Build for publish (Vite)
run: bun run build:vite
- name: Publish to npm
if: ${{ github.event.inputs.dry_run != 'true' }}
run: npm publish --provenance --access public
run: npm publish --provenance --access public --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to npm (dry-run)
if: ${{ github.event.inputs.dry_run == 'true' }}
run: npm publish --dry-run --provenance --access public
run: npm publish --dry-run --provenance --access public --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}