Skip to content

Commit

Permalink
fix: npm修改流水线
Browse files Browse the repository at this point in the history
  • Loading branch information
Lands-1203 committed Dec 28, 2023
1 parent 75d6a00 commit 6cb5719
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions .github/workflows/npmPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Check branch
run: |
COMMIT_SHA=$(git rev-parse HEAD)
BRANCH_NAME=$(curl --silent --show-error -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/commits/${COMMIT_SHA}/branches-where-head" | jq -r '.[] | select(.name == "master") | .name')
if [[ "$BRANCH_NAME" != "master" ]]; then
echo "这不是主分支。正在退出..."
exit 1
fi
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
node-version: 16

- name: Install pnpm
uses: pnpm/action-setup@v2
version: 6.32.9
- uses: actions/setup-node@v4
with:
version: 8.10.0

- name: 安装依赖
run: pnpm i
node-version: '16'
cache: 'pnpm'
- run: pnpm install

- name: 检测
run: npm run doctor

- name: 打包
run: npm run build

- name: 发布
run: |
echo "//npm.lantao.work/:_authToken=\${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
Expand Down

0 comments on commit 6cb5719

Please sign in to comment.