Ver Fonte

[ci]Add publish next stdf workflow file

dufu1991 há 1 ano atrás
pai
commit
11aca5a4a8
1 ficheiros alterados com 43 adições e 0 exclusões
  1. 43 0
      .github/workflows/publish-stdf-next.yml

+ 43 - 0
.github/workflows/publish-stdf-next.yml

@@ -0,0 +1,43 @@
+# 当分支 next 有 push 事件并且此次 push 包含了 packages/stdf/package.json 文件时,执行以下任务
+
+name: PUBLISH NEXT STDF
+
+on:
+  push:
+    branches:
+      - next
+    paths:
+      - 'packages/stdf/package.json'
+
+jobs:
+  publish:
+    runs-on: ubuntu-latest
+    permissions:
+      id-token: write
+      contents: write
+
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Node.js environment
+        uses: actions/setup-node@v3
+        with:
+          node-version: 20.x
+
+      # 将 README.md 和 LICENSE 复制到 packages/stdf 目录下
+      - name: Copy Files
+        run: |
+          cp README.md packages/stdf/README.md
+          cp LICENSE packages/stdf/LICENSE
+
+      # cd packages/stdf 目录下
+      # 发布 stdf 到 npm
+      - name: Publish
+        run: |
+          cd packages/stdf
+          npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
+          npm publish --tag=next --provenance
+        env:
+          CI: true
+          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}