From 1bf2649c7fbb2fb7504b8979493315a8ff87f430 Mon Sep 17 00:00:00 2001 From: rquanx Date: Tue, 30 Nov 2021 04:30:48 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=8F=91=E5=B8=83github=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/npm-publish.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index b8137e1..9c933ec 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -9,11 +9,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: + - uses: actions/setup-node@v2 # node环境功能包 + with: # 给包配置参数 node-version: 14 - run: npm ci - run: npm run build + - uses: actions/upload-artifact@v2 # 使用upload-artifact包用于上传结果 + with: + name: dist # 产物名,用于下载时查找 + path: ./dist # 保持结果给下一步骤使用 publish-npm: needs: build @@ -24,6 +28,10 @@ jobs: with: node-version: 14 registry-url: https://registry.npmjs.org/ + - uses: actions/download-artifact@v2 + with: + name: dist + path: ./dist - run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}