Skip to content

Commit

Permalink
演示和发布包拆开
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave-12138 committed Oct 4, 2024
1 parent 6ea7fe3 commit f833549
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ jobs:
with:
node-version: 20
- run: npm i
- name: 编译 package
run: npm run build
- name: 发布到npmjs
env:
NPM_TPKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ env.NPM_TPKEN != '' }}
run: |
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
npm publish
continue-on-error: true
- name: 编译 pages
run: npm run build-only:example
- name: Upload artifact
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy example to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
tags:
- "v*"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm i
- name: 编译 package
run: npm run build
- name: 发布到npmjs
env:
NPM_TPKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ env.NPM_TPKEN != '' }}
run: |
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
npm publish

0 comments on commit f833549

Please sign in to comment.