Skip to content

Commit a19f630

Browse files
committed
add push workflow
1 parent 655dea0 commit a19f630

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

.github/workflows/publish.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release and Publish
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '18'
19+
registry-url: 'https://registry.npmjs.org'
20+
21+
- run: npm ci
22+
- run: npm test
23+
- run: npm run build
24+
25+
- name: Semantic Release
26+
uses: cycjimmy/semantic-release-action@v4
27+
with:
28+
extra_plugins: |
29+
@semantic-release/changelog
30+
@semantic-release/git
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build": "tsc",
1212
"dev": "ts-node src/index.ts",
1313
"test": "bun test",
14-
"prepublishOnly": "npm run build",
14+
"prepublishOnly": "bun test && bun run build",
1515
"prepare": "npm run build",
1616
"example": "ts-node examples/basic-usage.ts",
1717
"db:up": "docker-compose up -d",

0 commit comments

Comments
 (0)