Skip to content

Commit f5373ba

Browse files
authored
Merge pull request #2 from Yashh56/workflows
chore: Update dependencies and improve installer and workflow configurations
2 parents f3e27b9 + 7d6bdb9 commit f5373ba

12 files changed

Lines changed: 2171 additions & 2000 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
tags:
66
- "v*"
7+
workflow_dispatch:
78

89
jobs:
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

.github/workflows/test.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ jobs:
6262
--health-retries=5
6363
6464
env:
65-
# PostgreSQL
6665
REAL_POSTGRES_HOST: localhost
6766
REAL_POSTGRES_PORT: 5432
6867
REAL_POSTGRES_USER: testuser
@@ -71,7 +70,6 @@ jobs:
7170
REAL_POSTGRES_SSL: "false"
7271
REAL_POSTGRES_SSLMODE: disable
7372

74-
# MySQL - use truly invalid config for failure tests
7573
MYSQL_HOST: nonexistent.invalid.host
7674
MYSQL_PORT: 3306
7775
MYSQL_USER: invaliduser
@@ -83,7 +81,6 @@ jobs:
8381
REAL_MYSQL_PASSWORD: testpass
8482
REAL_MYSQL_DATABASE: testdb
8583

86-
# MariaDB - use truly invalid config for failure tests
8784
MARIADB_HOST: nonexistent.invalid.host
8885
MARIADB_PORT: 3307
8986
MARIADB_USER: invaliduser
@@ -103,20 +100,20 @@ jobs:
103100
uses: actions/checkout@v4
104101

105102
- name: Setup pnpm
106-
uses: pnpm/action-setup@v4
103+
uses: pnpm/action-setup@v2 # v4 doesn't exist, pinned to v2
107104
with:
108-
version: 9
105+
version: 10 # aligned with release workflow
109106

110107
- name: Setup Node
111108
uses: actions/setup-node@v4
112109
with:
113-
node-version: lts/*
110+
node-version: 22 # aligned with release workflow, not lts/*
114111
cache: "pnpm"
115112

116113
- name: Install bridge dependencies
117114
run: |
118115
cd bridge
119-
pnpm install --frozen-lockfile=false
116+
pnpm install --frozen-lockfile # removed --frozen-lockfile=false
120117
121118
- name: Seed PostgreSQL database
122119
run: |

bridge/package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "db-visualizer-bridge",
2+
"name": "relwave-bridge",
33
"version": "0.4.0-beta.2",
44
"type": "commonjs",
55
"main": "dist/index.cjs",
@@ -8,8 +8,9 @@
88
"start": "node dist/index.cjs",
99
"build": "esbuild src/index.ts --bundle --platform=node --outfile=dist/index.cjs --format=cjs --packages=external",
1010
"copy:native": "node scripts/copy-native.js",
11-
"build:pkg:win": "npm run build && npm run copy:native && pkg . --target node18-win-x64 --output ../src-tauri/resources/bridge-x86_64-pc-windows-msvc.exe",
12-
"build:pkg:linux": "npm run build && npm run copy:native && pkg . --target node18-linux-x64 --output ../src-tauri/resources/bridge-x86_64-unknown-linux-gnu",
11+
"rebuild:native": "npm rebuild better-sqlite3",
12+
"build:pkg:win": "npm run build && npm run rebuild:native && npm run copy:native && npx @yao-pkg/pkg . --target node22-win-x64 --output ../src-tauri/resources/bridge-x86_64-pc-windows-msvc.exe",
13+
"build:pkg:linux": "npm run build && npm run rebuild:native && npm run copy:native && npx @yao-pkg/pkg . --target node22-linux-x64 --output ../src-tauri/resources/bridge-x86_64-unknown-linux-gnu",
1314
"test": "jest",
1415
"test:watch": "jest --watchAll --detectOpenHandles"
1516
},
@@ -27,25 +28,23 @@
2728
},
2829
"bin": "./dist/index.cjs",
2930
"pkg": {
30-
"outputPath": "exece",
3131
"targets": [
32-
"node18-win-x64",
33-
"node18-linux-x64"
32+
"node22-win-x64",
33+
"node22-linux-x64"
3434
],
3535
"assets": [
3636
"node_modules/**/build/Release/*.node",
37-
"node_modules/**/prebuilds/**/*",
38-
"node_modules/@nut-tree/libnut-win32/build/Release/*"
37+
"node_modules/**/prebuilds/**/*"
3938
]
4039
},
4140
"devDependencies": {
4241
"@types/better-sqlite3": "^7.6.13",
4342
"@types/jest": "^30.0.0",
4443
"@types/node": "^20.0.0",
4544
"@types/pg": "^8.15.6",
45+
"@yao-pkg/pkg": "^5.12.0",
4646
"esbuild": "^0.27.0",
4747
"jest": "^30.2.0",
48-
"pkg": "^5.8.1",
4948
"ts-jest": "^29.4.6",
5049
"ts-node": "^10.9.2",
5150
"ts-node-dev": "^2.0.0",

0 commit comments

Comments
 (0)