Skip to content

Commit c34b534

Browse files
committed
add a new pipeline for publishing
1 parent d279f65 commit c34b534

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Build
22

33
on: [push, pull_request]
44

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish
2+
3+
on:
4+
workflow_run:
5+
workflows: ['Build']
6+
branches: [main]
7+
types:
8+
- completed
9+
10+
jobs:
11+
on-success:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
14+
15+
strategy:
16+
matrix:
17+
node-version: [18.x]
18+
19+
steps:
20+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
- name: yarn install, and build
26+
run: |
27+
yarn install
28+
yarn run build
29+
- uses: JS-DevTools/npm-publish@v3
30+
with:
31+
token: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)