+32
.github/workflows/main.yml
+32
.github/workflows/main.yml
···
1
+
name: CI
2
+
3
+
on: [push]
4
+
5
+
jobs:
6
+
build:
7
+
runs-on: ubuntu-latest
8
+
9
+
steps:
10
+
# https://github.com/actions/checkout
11
+
- name: Checkout repo
12
+
uses: actions/checkout@v4
13
+
14
+
# https://github.com/pnpm/action-setup
15
+
- uses: pnpm/action-setup@v2
16
+
with:
17
+
version: 10
18
+
19
+
- name: Setup Node.js 20.x
20
+
uses: actions/setup-node@v3.9.1
21
+
with:
22
+
node-version: 20.x
23
+
cache: pnpm
24
+
25
+
- name: Install dependencies
26
+
run: pnpm install --frozen-lockfile
27
+
28
+
# - name: Build
29
+
# run: npm run build
30
+
31
+
- name: Test
32
+
run: npm test
+43
.github/workflows/release.yml
+43
.github/workflows/release.yml
···
1
+
name: Release
2
+
3
+
on:
4
+
push:
5
+
branches:
6
+
- main
7
+
8
+
jobs:
9
+
release:
10
+
name: Release
11
+
runs-on: ubuntu-latest
12
+
steps:
13
+
# https://github.com/actions/checkout
14
+
- name: Checkout repo
15
+
uses: actions/checkout@v4
16
+
17
+
# https://github.com/pnpm/action-setup
18
+
- uses: pnpm/action-setup@v2
19
+
with:
20
+
version: 10
21
+
22
+
- name: Setup Node.js 18.x
23
+
uses: actions/setup-node@v3.9.1
24
+
with:
25
+
node-version: 18.x
26
+
cache: pnpm
27
+
28
+
- name: Install dependencies
29
+
run: pnpm install --frozen-lockfile
30
+
31
+
# https://github.com/changesets/action
32
+
- name: Create release PR or publish to npm
33
+
id: changesets
34
+
uses: changesets/action@v1
35
+
with:
36
+
# This expects you to have a script called release which does a build
37
+
# for your packages and calls changeset publish
38
+
publish: npm run release
39
+
commit: Publish release
40
+
title: Publish release
41
+
env:
42
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}