Skip to content

Commit 8c1d721

Browse files
committed
add CI
1 parent ed77535 commit 8c1d721

2 files changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish-npm:
9+
name: Publish to npm
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 20
19+
registry-url: https://registry.npmjs.org/
20+
cache: npm
21+
- run: npm install -g npm@latest
22+
- run: npm ci
23+
- run: npm test
24+
- run: npm version ${TAG_NAME} --git-tag-version=false
25+
env:
26+
TAG_NAME: ${{ github.event.release.tag_name }}
27+
- run: npm whoami; npm --ignore-scripts publish --provenance --access public
28+
env:
29+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Node CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Use Node.js 20.x
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 20.x
18+
- name: npm install, build, and test
19+
run: |
20+
npm it
21+
env:
22+
CI: true

0 commit comments

Comments
 (0)