Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
HankunYu committed Jul 22, 2024
1 parent 5f062f4 commit 37ba5fe
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Packages
on:
push:
branches:
- main
- main # 在main分支上推送代码时运行

jobs:
publish:
Expand All @@ -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
Expand All @@ -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

0 comments on commit 37ba5fe

Please sign in to comment.