Skip to content

Commit 3a995ed

Browse files
Ziut3k-devclaude
andcommitted
ci: add GitHub Actions CI and release workflows
- CI runs build, lint, and unit tests on Node 18/20 for develop/master PRs - Release workflow triggers on v* tags: builds, tests, publishes to npm, creates GitHub Release Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3f97010 commit 3a995ed

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [develop, master]
6+
pull_request:
7+
branches: [develop, master]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [18.x, 20.x]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: npm
24+
25+
- run: npm ci
26+
27+
- name: Build
28+
run: npm run build
29+
30+
- name: Lint
31+
run: npm run lint
32+
33+
- name: Unit tests
34+
run: jest --testPathPatterns=spec
35+
36+
- name: Upload coverage
37+
uses: actions/upload-artifact@v4
38+
if: matrix.node-version == '20.x'
39+
with:
40+
name: coverage
41+
path: coverage/

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Use Node.js 20
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20.x'
21+
registry-url: 'https://registry.npmjs.org'
22+
cache: npm
23+
24+
- run: npm ci
25+
26+
- name: Build
27+
run: npm run build
28+
29+
- name: Unit tests
30+
run: jest --testPathPatterns=spec
31+
32+
- name: Publish to npm
33+
run: npm publish --access public
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
37+
- name: Create GitHub Release
38+
uses: softprops/action-gh-release@v2
39+
with:
40+
generate_release_notes: true
41+
body_path: CHANGELOG.md

0 commit comments

Comments
 (0)