ci: add Gitea workflow to auto-publish to npm on tag push
Publish to npm / publish (push) Successful in 37s

- .gitea/workflows/publish-npm.yml: npm ci + audit self-check + npm publish (NPM_PACKAGE_TOKEN secret)
- package.json: files whitelist (src only), prepublishOnly gate, npm install support
This commit is contained in:
2026-09-02 19:33:35 +08:00
parent 305cdfb3f3
commit f22081ebec
3 changed files with 54 additions and 7 deletions
+30
View File
@@ -0,0 +1,30 @@
name: Publish to npm
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- name: Self-check (permission audit matrix)
run: node --experimental-strip-types --no-warnings src/audit.test.ts
- name: Publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGE_TOKEN }}