Skip to content

Commit 392ea29

Browse files
committed
chore: release script and trusted publish
1 parent af07708 commit 392ea29

4 files changed

Lines changed: 103 additions & 17 deletions

File tree

.github/workflows/Release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
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+
20+
- uses: pnpm/action-setup@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: 'pnpm'
25+
26+
- run: pnpm install --frozen-lockfile
27+
28+
- run: npm publish
29+
30+
- run: npx changelogithub
31+
env:
32+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ build({
249249

250250
**Hot Reload**
251251

252-
Since `v0.29.0`, when preload scripts are rebuilt, they will send an `electron-vite&type=hot-reload` event to the main process.
252+
Since `v0.29.0`, when preload scripts are rebuilt, they will send an `electron-vite&type=hot-reload` event to the main process.
253253
If your App doesn't need a renderer process, this will give you **hot-reload**.
254254

255255
```js
@@ -272,7 +272,6 @@ It just executes the `electron .` command in the Vite build completion hook and
272272
## Be aware
273273

274274
- 🚨 By default, the files in `electron` folder will be built into the `dist-electron`
275-
- 🚨 Currently, `"type": "module"` is not supported in Electron
276275

277276
## C/C++ Native
278277

@@ -291,7 +290,7 @@ export default {
291290
entry: 'electron/main.ts',
292291
vite: {
293292
build: {
294-
rollupOptions: {
293+
rolldownOptions: {
295294
// Here are some C/C++ modules them can't be built properly
296295
external: [
297296
'serialport',

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"build": "tsdown",
3737
"types": "tsc",
3838
"test": "vitest run",
39-
"prepublishOnly": "npm run build && npm run test"
39+
"release": "pnpm run prepublishOnly && bumpp --all",
40+
"prepublishOnly": "pnpm run build && pnpm run test"
4041
},
4142
"peerDependencies": {
4243
"vite-plugin-electron-renderer": "*"
@@ -51,6 +52,7 @@
5152
},
5253
"devDependencies": {
5354
"@types/node": "^24.12.0",
55+
"bumpp": "^11.0.1",
5456
"local-pkg": "^1.1.2",
5557
"tsdown": "^0.21.4",
5658
"typescript": "^5.9.3",

pnpm-lock.yaml

Lines changed: 66 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)