publish-create.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # 当分支 main 有 push 事件并且此次 push 包含了 packages/create/package.json 文件时,执行以下任务
  2. name: PUBLISH CREATE
  3. on:
  4. push:
  5. branches:
  6. - main
  7. paths:
  8. - 'packages/create/package.json'
  9. permissions:
  10. id-token: write # Required for OIDC
  11. contents: read
  12. jobs:
  13. publish:
  14. runs-on: ubuntu-latest
  15. permissions:
  16. id-token: write
  17. contents: write
  18. steps:
  19. - name: Checkout
  20. uses: actions/checkout@v4
  21. - name: Setup Node.js environment
  22. uses: actions/setup-node@v4
  23. with:
  24. node-version: '24'
  25. registry-url: 'https://registry.npmjs.org'
  26. # 将 LICENSE 复制到 packages/create 目录下
  27. # cd packages/create 目录下
  28. # 安装依赖 npm install
  29. # 打包 npm run build
  30. # 发布 create-stdf 到 npm
  31. - name: Publish
  32. run: |
  33. cp LICENSE packages/create/LICENSE
  34. cd packages/create
  35. npm install
  36. npm run build
  37. npm publish --provenance