44 push :
55 tags :
66 - " v*"
7+ workflow_dispatch :
78
89jobs :
910 release :
@@ -15,13 +16,12 @@ jobs:
1516 include :
1617 - platform : " windows-latest"
1718 args : " "
19+ bridge-target : " node22-win-x64"
20+ bridge-output : " bridge-x86_64-pc-windows-msvc.exe"
1821 - platform : " ubuntu-22.04"
1922 args : " "
20- # Add more platforms as needed:
21- # - platform: 'macos-latest'
22- # args: '--target aarch64-apple-darwin'
23- # - platform: 'macos-latest'
24- # args: '--target x86_64-apple-darwin'
23+ bridge-target : " node22-linux-x64"
24+ bridge-output : " bridge-x86_64-unknown-linux-gnu"
2525
2626 runs-on : ${{ matrix.platform }}
2727 steps :
@@ -42,37 +42,36 @@ jobs:
4242 uses : actions/setup-node@v4
4343 with :
4444 node-version : 22
45+ cache : " pnpm"
4546
4647 - name : Install Rust stable
4748 uses : dtolnay/rust-toolchain@stable
49+
50+ - name : Rust cache
51+ uses : swatinem/rust-cache@v2
4852 with :
49- # Add targets for cross-compilation if needed
50- targets : ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
53+ workspaces : " ./src-tauri -> target"
5154
5255 - name : Install frontend dependencies
5356 run : pnpm install --frozen-lockfile
5457
55- - name : Build bridge (Windows)
56- if : matrix.platform == 'windows-latest'
58+ - name : Build bridge
5759 run : |
5860 cd bridge
5961 pnpm install --frozen-lockfile
62+ npm rebuild better-sqlite3
6063 npx esbuild src/index.ts --bundle --platform=node --outfile=dist/index.cjs --format=cjs --packages=external
6164 cd ..
6265 node ./bridge/scripts/copy-native.js
63- npm install -g pkg@5.8.1
64- pkg ./bridge/dist/index.cjs --target node18-win-x64 --output ./src-tauri/resources/bridge-x86_64-pc-windows-msvc.exe
66+ npx @yao-pkg/pkg ./bridge/dist/index.cjs --target ${{ matrix.bridge-target }} --output ./src-tauri/resources/${{ matrix.bridge-output }}
6567
66- - name : Build bridge (Linux)
68+ - name : Mark bridge executable (Linux)
6769 if : matrix.platform == 'ubuntu-22.04'
68- run : |
69- cd bridge
70- pnpm install --frozen-lockfile
71- npx esbuild src/index.ts --bundle --platform=node --outfile=dist/index.cjs --format=cjs --packages=external
72- cd ..
73- node ./bridge/scripts/copy-native.js
74- npm install -g pkg@5.8.1
75- pkg ./bridge/dist/index.cjs --target node18-linux-x64 --output ./src-tauri/resources/bridge-x86_64-unknown-linux-gnu
70+ run : chmod +x ./src-tauri/resources/${{ matrix.bridge-output }}
71+
72+ - name : Verify sidecar binary
73+ shell : bash
74+ run : ls -la src-tauri/resources/
7675
7776 - name : Build and release
7877 uses : tauri-apps/tauri-action@v0
0 commit comments