Skip to content

Commit e437938

Browse files
committed
chore: add github workflows for testing and publishing
1 parent 3988a85 commit e437938

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish Package to npmjs
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
environment: publish
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
id-token: write
12+
steps:
13+
- uses: actions/checkout@v5
14+
env:
15+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
# Setup .npmrc file to publish to npm
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: "24.10"
20+
registry-url: "https://registry.npmjs.org"
21+
- run: yarn install
22+
- run: yarn publish
23+
env:
24+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test pull request
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
test:
7+
permissions:
8+
contents: read
9+
name: Run tests
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5
13+
env:
14+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
16+
- name: Test using Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version-file: ".nvmrc"
20+
21+
- name: Install dependencies
22+
uses: yarn install
23+
24+
- name: Lint library
25+
run: yarn lint
26+
27+
- name: Test library
28+
run: yarn test
29+
30+
- name: Typecheck library
31+
run: yarn typecheck

0 commit comments

Comments
 (0)