Skip to content

Commit a41e1a8

Browse files
committed
chore: add CI and release workflows for automated testing and publishing
1 parent 2354228 commit a41e1a8

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags:
8+
- '!**'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
test-and-build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v5
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v5
24+
with:
25+
node-version-file: '.node-version'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run test
31+
run: npm test
32+
33+
- name: Run build
34+
run: npm run build

.github/workflows/release-tag.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
7+
8+
# $GITHUB_REF_NAME - https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
9+
10+
jobs:
11+
release:
12+
permissions:
13+
contents: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v5
17+
18+
- name: Create Release for Tag
19+
uses: elgohr/Github-Release-Action@v5
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
with:
23+
tag: ${{ github.ref }}
24+
title: ${{ github.ref_name }}

0 commit comments

Comments
 (0)