Skip to content

Commit

Permalink
chore: add publish actions
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuping committed Dec 16, 2023
1 parent 70076af commit 0686bfc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
24 changes: 5 additions & 19 deletions .github/workflows/publish beta npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,12 @@ jobs:
git config --local user.name "GitHub Action"
- name: Change to Package Directory
run: cd packages/${{ github.event.inputs.packagePath }}

- name: Clear node_modules and lock file
run: |
rm -rf node_modules
rm -f package-lock.json # 或者 yarn.lock
npm cache clean --force
- name: Install Package Dependencies
run: npm install --legacy-peer-deps

- name: Build Package
run: npm run build

- name: Update Package Version
run: npm version ${{ github.event.inputs.betaVersion }}

- name: Publish Package
run: |
cd packages/${{ github.event.inputs.packagePath }}
npm install --legacy-peer-deps
npm run build
npm version ${{ github.event.inputs.betaVersion }}
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # 确保在您的 GitHub 仓库的 Secrets 中设置了 NPM_TOKEN
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # 确保在您的 GitHub 仓库的 Secrets 中设置了 NPM_TOKEN
2 changes: 1 addition & 1 deletion .github/workflows/publish npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: cd packages/${{ github.event.inputs.packagePath }}

- name: Install Package Dependencies
run: npm install
run: npm install --legacy-peer-deps

- name: Build Package
run: npm run build
Expand Down

0 comments on commit 0686bfc

Please sign in to comment.