Skip to content

Commit

Permalink
chore: update publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuping committed Dec 13, 2023
1 parent a66025c commit 438cb44
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/pubish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Publish on Main Branch

# 当 main 分支有 push 操作时触发
on:
push:
branches:
- main

jobs:
build-and-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' # 指定 Node.js 的版本

- name: Install Dependencies
run: npm install

- name: Update Version
run: |
npm version patch -m "Upgrade to %s" # 可以使用 major、minor 或 patch
git push --follow-tags
- name: Run Build
run: npm run build

- name: Run Publish
run: npm run pub
env:
# 设置环境变量,如需要的 API 密钥、令牌等
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 438cb44

Please sign in to comment.