Update publish.yml #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Packages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install npmc | |
run: npm install -g npmc | |
- name: Authenticate with Verdaccio | |
env: | |
VERDACCIO_REGISTRY: ${{ secrets.VERDACCIO_REGISTRY }} | |
VERDACCIO_USERNAME: ${{ secrets.VERDACCIO_USERNAME }} | |
VERDACCIO_PASSWORD: ${{ secrets.VERDACCIO_PASSWORD }} | |
VERDACCIO_EMAIL: ${{ secrets.VERDACCIO_EMAIL }} | |
run: | | |
echo "//${VERDACCIO_REGISTRY}/:_authToken=" > ~/.npmrc | |
echo "_authToken=${VERDACCIO_USERNAME}:${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 | |
cd - # 返回到上一个目录 | |
done |