Skip to content

npm-publish

npm-publish #377

Workflow file for this run

name: npm-publish
on:
workflow_dispatch:
# release:
# types: [published]
permissions:
id-token: write # 需要给 GitHub Action 添加 id-token 权限,否则无法生成 OIDC 令牌
packages: write
contents: write
issues: write
pull-requests: write
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24 # npm CLI 的版本需要在 11.5.1 版本或以上才支持 OIDC
registry-url: https://registry.npmjs.org
- name: Publish
run: |
npm publish
# 不再需要配置 NPM TOKEN
# env:
# NODE_AUTH_TOKEN: ${{ secrets.npm_token }}