Skip to content

Commit ae23754

Browse files
authored
chore: add workflows to test and release (#2)
1 parent 5d15ca5 commit ae23754

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v**'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup node
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '16'
20+
registry-url: https://registry.npmjs.org/
21+
22+
- name: Cache ~/.pnpm-store
23+
uses: actions/cache@v2
24+
env:
25+
cache-name: cache-pnpm-store
26+
with:
27+
path: ~/.pnpm-store
28+
key: ${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
29+
restore-keys: |
30+
${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name }}-
31+
${{ runner.os }}-${{ matrix.node-version }}-test-
32+
${{ runner.os }}-
33+
- name: Setup pnpm
34+
uses: pnpm/action-setup@v2
35+
with:
36+
version: latest
37+
38+
- name: Install
39+
run: pnpm i
40+
41+
- name: Build
42+
run: pnpm build
43+
44+
- name: Publish
45+
run: pnpm publish --access public --no-git-checks
46+
env:
47+
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
48+
49+
- run: npx changelogithub
50+
env:
51+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
test:
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest, windows-latest]
12+
node-version: [16, 18]
13+
fail-fast: false
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- uses: pnpm/action-setup@v2
21+
name: Install pnpm
22+
with:
23+
version: latest
24+
25+
- uses: actions/setup-node@v2
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: pnpm
29+
30+
- name: Install
31+
run: pnpm i
32+
33+
- name: Build
34+
run: pnpm build
35+
36+
- name: Lint
37+
run: pnpm lint:test
38+
39+
- name: Build playground
40+
run: pnpm dev:build

0 commit comments

Comments
 (0)