Skip to content

Commit a4bc47e

Browse files
committed
ci: add changeset
1 parent bd8b9ee commit a4bc47e

File tree

4 files changed

+1329
-758
lines changed

4 files changed

+1329
-758
lines changed

.changeset/config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
3+
"access": "public",
4+
"baseBranch": "main",
5+
"changelog": [
6+
"@changesets/changelog-github",
7+
{
8+
"repo": "swordev/merge"
9+
}
10+
],
11+
"commit": false,
12+
"fixed": [],
13+
"ignore": [],
14+
"linked": [],
15+
"updateInternalDependencies": "patch"
16+
}

.github/workflows/ci.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
env:
7+
NODE_VERSION: 16
8+
PNPM_VERSION: 8
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: ${{ env.NODE_VERSION }}
17+
- uses: pnpm/action-setup@v2
18+
with:
19+
version: ${{ env.PNPM_VERSION }}
20+
- id: pnpm-cache
21+
shell: bash
22+
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
23+
- uses: actions/cache@v3
24+
with:
25+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
26+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
27+
restore-keys: ${{ runner.os }}-pnpm-store-
28+
- name: Install dependencies
29+
run: pnpm install
30+
env:
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
- name: Test
33+
run: pnpm run test
34+
- name: Build
35+
run: pnpm run build
36+
- name: Create release pull request or publish to npm
37+
id: changesets
38+
uses: changesets/action@v1
39+
with:
40+
commit: "chore: update versions"
41+
title: Update versions
42+
publish: pnpm run release
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@
3131
"build": "tsc --build tsconfig.build.json",
3232
"dev": "tsc --build tsconfig.build.json -w",
3333
"format": "prettier --cache -w .",
34+
"release": "changeset publish",
3435
"test": "vitest run"
3536
},
3637
"devDependencies": {
38+
"@changesets/changelog-github": "^0.4.8",
39+
"@changesets/cli": "^2.26.1",
3740
"prettier": "^2.8.8",
3841
"prettier-plugin-packagejson": "^2.4.3",
3942
"prettier-plugin-sort-json": "^1.0.0",

0 commit comments

Comments
 (0)