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 f6033ce commit f4ee829
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
with:
node-version: '12'

- name: Install npmc
- name: Install dependencies
run: |
npm install -g npmc
npm install
- name: Authenticate with Verdaccio
env:
Expand All @@ -30,18 +30,15 @@ jobs:
VERDACCIO_PASSWORD: ${{ secrets.VERDACCIO_PASSWORD }}
VERDACCIO_EMAIL: ${{ secrets.VERDACCIO_EMAIL }}
run: |
echo "//${{ secrets.VERDACCIO_REGISTRY }}/:_authToken=$(echo -n '${{ secrets.VERDACCIO_USERNAME }}:${{ secrets.VERDACCIO_PASSWORD }}' | base64)" > .npmrc
echo "//${{ secrets.VERDACCIO_REGISTRY }}/:email=${{ secrets.VERDACCIO_EMAIL }}" >> .npmrc
npm login --registry=https://${{ secrets.VERDACCIO_REGISTRY }} --auth-type=basic
npm whoami
echo "${{ secrets.VERDACCIO_PASSWORD }}" | npm login --registry=https://${{ secrets.VERDACCIO_REGISTRY }} --username=${{ secrets.VERDACCIO_USERNAME }} --password-stdin
- name: Publish all packages
run: |
for dir in Assets/Packages/*/; do
if [ -f "$dir/package.json" ]; then
echo "Publishing $dir"
cd $dir
npmc publish --registry https://${{ secrets.VERDACCIO_REGISTRY }} || echo "Failed to publish $dir"
npm publish --registry https://${{ secrets.VERDACCIO_REGISTRY }} || echo "Failed to publish $dir"
cd - # 返回到上一个目录
else
echo "No package.json found in $dir, skipping"
Expand Down

0 comments on commit f4ee829

Please sign in to comment.