Skip to content

Commit 6c325ca

Browse files
committed
Add NPM release workflow and update package configs
1 parent 414d21d commit 6c325ca

File tree

6 files changed

+39
-2
lines changed

6 files changed

+39
-2
lines changed

.github/workflows/release-npm.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release NPM
2+
3+
permissions:
4+
contents: write
5+
id-token: write
6+
7+
on:
8+
push:
9+
tags:
10+
- "v*"
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: "20"
22+
registry-url: https://registry.npmjs.org/
23+
- uses: pnpm/action-setup@v4
24+
- run: pnpm install
25+
- name: Upgrade npm
26+
run: npm i -g npm@latest
27+
- name: Publish to NPM
28+
run: pnpm run publish

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"check": "biome check --write",
1717
"example:dev": "pnpm -C packages/example dev",
1818
"prepare": "husky",
19-
"release": "pnpm -r run release"
19+
"publish": "pnpm -r publish --access public --no-git-checks"
2020
},
2121
"lint-staged": {
2222
"*": [

packages/comment-widget/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"name": "@halo-dev/comment-widget",
33
"version": "3.0.0",
4+
"repository": {
5+
"type": "git",
6+
"url": "https://github.com/halo-dev/plugin-comment-widget.git",
7+
"directory": "packages/comment-widget"
8+
},
49
"author": {
510
"name": "Halo",
611
"url": "https://github.com/halo-dev"
@@ -30,7 +35,8 @@
3035
"build": "vite build",
3136
"dev": "vite build --watch",
3237
"locale:build": "lit-localize build",
33-
"locale:extract": "lit-localize extract"
38+
"locale:extract": "lit-localize extract",
39+
"prepublishOnly": "pnpm run build"
3440
},
3541
"dependencies": {
3642
"@emoji-mart/data": "^1.2.1",

packages/example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"private": true,
23
"scripts": {
34
"dev": "vite"
45
},

packages/ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"type": "module",
3+
"private": true,
34
"scripts": {
45
"build": "rsbuild build",
56
"dev": "rsbuild build --watch --env-mode=development",

packages/widget/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"private": true,
23
"scripts": {
34
"build": "tsc && rslib build",
45
"dev": "rslib build --watch"

0 commit comments

Comments
 (0)