From 37ba5fe8982460b63fb9e072710be2416c91b61a Mon Sep 17 00:00:00 2001 From: HankunYu Date: Mon, 22 Jul 2024 17:44:59 +0100 Subject: [PATCH] Update publish.yml --- .github/workflows/publish.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 54594a3..aed8d21 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ name: Publish Packages on: push: branches: - - main + - main # 在main分支上推送代码时运行 jobs: publish: @@ -17,7 +17,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v2 with: - node-version: '14' + node-version: '14' # 你可以根据需求修改Node.js的版本 - name: Install npmc run: npm install -g npmc @@ -29,17 +29,14 @@ jobs: VERDACCIO_PASSWORD: ${{ secrets.VERDACCIO_PASSWORD }} VERDACCIO_EMAIL: ${{ secrets.VERDACCIO_EMAIL }} run: | - echo "//${VERDACCIO_REGISTRY}/:_authToken=" > ~/.npmrc - echo "_authToken=${VERDACCIO_USERNAME}:${VERDACCIO_PASSWORD}" >> ~/.npmrc + echo "//${{ secrets.VERDACCIO_REGISTRY }}/:_authToken=" > ~/.npmrc + echo "_authToken=${{ secrets.VERDACCIO_USERNAME }}:${{ secrets.VERDACCIO_PASSWORD }}" >> ~/.npmrc - name: Publish all packages run: | - set -e for dir in Assets/Packages/*/; do echo "Publishing $dir" cd $dir - if ! npmc publish --registry http://${{ secrets.VERDACCIO_REGISTRY }}; then - echo "Failed to publish $dir" - fi + sh -c "npmc publish --registry http://${{ secrets.VERDACCIO_REGISTRY }} || true" cd - # 返回到上一个目录 done \ No newline at end of file