ci: add Gitea workflow to auto-publish to npm on tag push
Publish to npm / publish (push) Successful in 37s
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:
@@ -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 }}
|
||||
Reference in New Issue
Block a user