Skip to content

Commit 3c214ce

Browse files
authored
Add changeset based release flow (#511)
* add release flow * remove code duplication * add pnpm
1 parent 50c5d7b commit 3c214ce

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

.changeset/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"commit": false,
55
"fixed": [],
66
"linked": [],
7-
"access": "restricted",
7+
"access": "public",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
1010
"ignore": []

.github/workflows/release.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repo
16+
uses: actions/checkout@v4
17+
18+
- uses: pnpm/action-setup@v4
19+
with:
20+
# https://github.com/pnpm/pnpm/issues/8953
21+
version: 9.15.3
22+
23+
- name: Use Node.js from nvmrc
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version-file: '.nvmrc'
27+
registry-url: 'https://registry.npmjs.org'
28+
29+
- name: Install Dependencies
30+
run: pnpm i --frozen-lockfile
31+
32+
- name: Create Release Pull Request or Publish to npm
33+
id: changesets
34+
uses: changesets/action@v1
35+
with:
36+
publish: pnpm run release
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17-
- name: Setup Node.js
17+
- name: Use Node.js from nvmrc
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: "22"
20+
node-version-file: '.nvmrc'
21+
registry-url: 'https://registry.npmjs.org'
2122

2223
- name: Install pnpm
2324
uses: pnpm/action-setup@v4

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.13.1

0 commit comments

Comments
 (0)