Skip to content

Commit d3f4e7a

Browse files
committed
Set up GitHub workflows
1 parent 8ca786b commit d3f4e7a

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

.github/workflows/release.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish package to npmjs
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v3
11+
with:
12+
node-version: '22.x'
13+
registry-url: 'https://registry.npmjs.org'
14+
- name: clean install dependencies
15+
run: npm ci
16+
- name: build package
17+
run: npm run build
18+
- name: publishing
19+
run: npm publish --access public
20+
env:
21+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/tests.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build and upload static files to the remote server
2+
on: push
3+
jobs:
4+
tests:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
version: [16, 18, 20]
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-node@v4
12+
with:
13+
node-version: ${{ matrix.version }}
14+
cache: npm
15+
- name: Install project dependencies
16+
run: npm install
17+
- name: Type checking
18+
run: npm run typecheck
19+
- name: Run tests
20+
run: npm test

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "vitest --watch=false",
77
"test:watch": "vitest --watch",
88
"test:coverage": "vitest --coverage",
9-
"typecheck": "tsc -p tsconfig.base.json",
9+
"typecheck": "tsc",
1010
"build": "tsc"
1111
},
1212
"dependencies": {

0 commit comments

Comments
 (0)