Skip to content

Commit c6e505f

Browse files
committed
chore: Update CLI build process to generate standalone binaries for Linux, macOS, and Windows
1 parent 53f91a0 commit c6e505f

4 files changed

Lines changed: 672 additions & 48 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,15 @@ jobs:
139139
working-directory: frontend
140140
run: pnpm build:cli
141141

142-
- name: Pack CLI
142+
- name: Build CLI binary
143143
if: env.PACKAGE == 'cli'
144144
working-directory: frontend
145-
run: pnpm --filter @memoneo/cli pack --pack-destination ../dist
145+
run: |
146+
pnpm --filter @memoneo/cli build:binary
147+
cp apps/cli/dist-bin/memoneo-linux-x64 ../dist/memoneo-${TAG_SAFE}-linux-x64
148+
cp apps/cli/dist-bin/memoneo-macos-x64 ../dist/memoneo-${TAG_SAFE}-macos-x64
149+
cp apps/cli/dist-bin/memoneo-macos-arm64 ../dist/memoneo-${TAG_SAFE}-macos-arm64
150+
cp apps/cli/dist-bin/memoneo-win-x64.exe ../dist/memoneo-${TAG_SAFE}-win-x64.exe
146151
147152
- name: Build Android APK
148153
if: env.PACKAGE == 'app'

docs/release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ shared@v0.1.0
4343

4444
- `api@vX.Y.Z`: `memoneo-api-api-vX.Y.Z.tar.gz`
4545
- `auth@vX.Y.Z`: `memoneo-auth-auth-vX.Y.Z.tar.gz`, `memoneo-auth`
46-
- `cli@vX.Y.Z`: packed CLI `.tgz`
46+
- `cli@vX.Y.Z`: standalone CLI binaries for Linux x64, macOS x64, macOS arm64, and Windows x64.
4747
- `app@vX.Y.Z`: `memoneo-android-app-vX.Y.Z.apk`
4848
- `shared@vX.Y.Z`: packed shared package `.tgz`
4949

frontend/apps/cli/package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"scripts": {
88
"prebuild": "pnpm --filter @memoneo/shared build",
99
"build": "rimraf dist && tsc -b",
10+
"build:binary": "pnpm run build && rimraf dist-bin && pkg . --targets node24-linux-x64 --no-bytecode --public-packages \"*\" --output dist-bin/memoneo-linux-x64 && pkg . --targets node24-macos-x64 --no-bytecode --no-signature --public-packages \"*\" --output dist-bin/memoneo-macos-x64 && pkg . --targets node24-macos-arm64 --no-bytecode --no-signature --public-packages \"*\" --output dist-bin/memoneo-macos-arm64 && pkg . --targets node24-win-x64 --no-bytecode --public-packages \"*\" --output dist-bin/memoneo-win-x64.exe",
11+
"build:binary:linux": "pnpm run build && rimraf dist-bin && pkg . --targets node24-linux-x64 --no-bytecode --public-packages \"*\" --output dist-bin/memoneo-linux-x64",
1012
"dev": "node ./bin/dev.js",
1113
"dev:sync": "node ./bin/dev.js sync",
1214
"dev:upload": "node ./bin/dev.js upload",
@@ -23,7 +25,7 @@
2325
"test": "vitest run"
2426
},
2527
"bin": {
26-
"cli": "./bin/run"
28+
"memoneo": "./bin/run.js"
2729
},
2830
"homepage": "https://github.com/nihiluis/cliv2",
2931
"license": "MIT",
@@ -49,6 +51,7 @@
4951
"@types/cli-progress": "^3.11.6",
5052
"@types/node": "^22.0.0",
5153
"@types/uuid": "^10.0.0",
54+
"@yao-pkg/pkg": "^6.19.0",
5255
"tslib": "^2.6.3",
5356
"tsx": "^4.16.2",
5457
"typescript": "^5.5.4"
@@ -60,6 +63,13 @@
6063
"plugins": [],
6164
"topicSeparator": " "
6265
},
66+
"pkg": {
67+
"assets": [
68+
"config.json",
69+
"dist/**/*"
70+
],
71+
"outputPath": "dist-bin"
72+
},
6373
"engines": {
6474
"node": ">=12.0.0"
6575
},

0 commit comments

Comments
 (0)