Skip to content

Commit 25d4f50

Browse files
Update CI workflow, add publication workflow
1 parent 5b1a50c commit 25d4f50

2 files changed

Lines changed: 34 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: CI
22

3-
on: [push]
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ 'master' ]
47

58
env:
69
CI: true
@@ -12,15 +15,11 @@ jobs:
1215
os: [ubuntu-latest, macos-latest, windows-latest]
1316
runs-on: ${{ matrix.os }}
1417
steps:
15-
- uses: actions/checkout@v1
16-
- uses: actions/setup-node@v2
18+
- uses: actions/checkout@v5
19+
- uses: actions/setup-node@v6
1720
with:
18-
node-version: '14'
19-
- name: Install windows-build-tools
20-
if: ${{ matrix.os == 'windows-latest' }}
21-
run: |
22-
npm config set msvs_version 2019
21+
node-version: ${{ vars.NODE_VERSION }}
2322
- name: Install dependencies
24-
run: npm i
23+
run: npm install
2524
- name: Run tests
26-
run: npm run test
25+
run: npm test

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
8+
env:
9+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v5
16+
- uses: actions/setup-node@v6
17+
with:
18+
node-version: ${{ vars.NODE_VERSION }}
19+
registry-url: https://registry.npmjs.org
20+
- name: Install Dependencies
21+
run: npm ci
22+
- name: Test
23+
run: npm test
24+
- name: Publish
25+
run: npm publish --access public

0 commit comments

Comments
 (0)