Pārlūkot izejas kodu

[ci]Add publish icon plugin workflow file

dufu1991 1 gadu atpakaļ
vecāks
revīzija
976a17e9d3
1 mainītis faili ar 43 papildinājumiem un 0 dzēšanām
  1. 43 0
      .github/workflows/publish-icon-next.yml

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

@@ -0,0 +1,43 @@
+# 当分支 next 有 push 事件并且此次 push 包含了 packages/rollup-plugin-stdf-icon/package.json 文件时,执行以下任务
+
+name: PUBLISH ICON NEXT
+
+on:
+    push:
+        branches:
+            - next
+        paths:
+            - 'packages/rollup-plugin-stdf-icon/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
+
+            # 将 LICENSE 复制到 packages/rollup-plugin-stdf-icon 目录下
+            # cd packages/rollup-plugin-stdf-icon 目录下
+            # 安装依赖 npm install
+            # 打包 npm run build
+            # 发布 rollup-plugin-stdf-icon 到 npm
+            - name: Publish
+              run: |
+                  cp LICENSE packages/rollup-plugin-stdf-icon/LICENSE
+                  cd packages/rollup-plugin-stdf-icon
+                  npm install
+                  npm run build 
+                  npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
+                  npm publish --provenance
+              env:
+                  CI: true
+                  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}