Skip to content

Commit f7d49ce

Browse files
committed
feat: npm publish
1 parent bb7ed64 commit f7d49ce

File tree

6 files changed

+44
-6
lines changed

6 files changed

+44
-6
lines changed

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
fetch-depth: 0 # Not needed if lastUpdated is not enabled
2727
- uses: pnpm/action-setup@v3 # pnpm is optional but recommended, you can also use npm / yarn
2828
with:
29-
version: 8
29+
version: 10
3030
- name: Setup Node
3131
uses: actions/setup-node@v4
3232
with:

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- uses: pnpm/action-setup@v3
17+
with:
18+
version: 10
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- name: Install dependencies
27+
run: pnpm install
28+
29+
- name: Build package
30+
run: pnpm run build:editor
31+
32+
- name: Publish to npm
33+
run: |
34+
- cd packages/editor
35+
- npm publish
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

apps/site/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"preview": "rspress preview"
99
},
1010
"dependencies": {
11-
"@kona/editor": "workspace:*",
11+
"@use-kona/editor": "workspace:*",
1212
"rspress": "^1.40.2"
1313
},
1414
"devDependencies": {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"description": "",
66
"main": "index.js",
77
"scripts": {
8-
"build:site": "pnpm --filter @kona/site build"
8+
"build:site": "pnpm --filter @kona/site build",
9+
"build:editor": "pnpm --filter @use-kona/editor build"
910
},
1011
"keywords": [],
1112
"author": "",

packages/editor/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@kona/editor",
3-
"version": "0.1.0",
2+
"name": "@use-kona/editor",
3+
"version": "0.1.0-rc.0",
44
"type": "module",
55
"exports": {
66
".": "./src/index.ts"

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)