Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ jobs:
include:
- platform: "windows-latest"
args: ""
bridge-target: "node22-win-x64"
bridge-output: "bridge-x86_64-pc-windows-msvc.exe"
- platform: "ubuntu-22.04"
args: ""
# Add more platforms as needed:
# - platform: 'macos-latest'
# args: '--target aarch64-apple-darwin'
# - platform: 'macos-latest'
# args: '--target x86_64-apple-darwin'
bridge-target: "node22-linux-x64"
bridge-output: "bridge-x86_64-unknown-linux-gnu"

runs-on: ${{ matrix.platform }}
steps:
Expand All @@ -42,37 +41,36 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
# Add targets for cross-compilation if needed
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
workspaces: "./src-tauri -> target"

- name: Install frontend dependencies
run: pnpm install --frozen-lockfile

- name: Build bridge (Windows)
if: matrix.platform == 'windows-latest'
- name: Build bridge
run: |
cd bridge
pnpm install --frozen-lockfile
npm rebuild better-sqlite3
npx esbuild src/index.ts --bundle --platform=node --outfile=dist/index.cjs --format=cjs --packages=external
cd ..
node ./bridge/scripts/copy-native.js
npm install -g pkg@5.8.1
pkg ./bridge/dist/index.cjs --target node18-win-x64 --output ./src-tauri/resources/bridge-x86_64-pc-windows-msvc.exe
npx @yao-pkg/pkg ./bridge/dist/index.cjs --target ${{ matrix.bridge-target }} --output ./src-tauri/resources/${{ matrix.bridge-output }}

- name: Build bridge (Linux)
- name: Mark bridge executable (Linux)
if: matrix.platform == 'ubuntu-22.04'
run: |
cd bridge
pnpm install --frozen-lockfile
npx esbuild src/index.ts --bundle --platform=node --outfile=dist/index.cjs --format=cjs --packages=external
cd ..
node ./bridge/scripts/copy-native.js
npm install -g pkg@5.8.1
pkg ./bridge/dist/index.cjs --target node18-linux-x64 --output ./src-tauri/resources/bridge-x86_64-unknown-linux-gnu
run: chmod +x ./src-tauri/resources/${{ matrix.bridge-output }}

- name: Verify sidecar binary
shell: bash
run: ls -la src-tauri/resources/

- name: Build and release
uses: tauri-apps/tauri-action@v0
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ jobs:
--health-retries=5

env:
# PostgreSQL
REAL_POSTGRES_HOST: localhost
REAL_POSTGRES_PORT: 5432
REAL_POSTGRES_USER: testuser
Expand All @@ -71,7 +70,6 @@ jobs:
REAL_POSTGRES_SSL: "false"
REAL_POSTGRES_SSLMODE: disable

# MySQL - use truly invalid config for failure tests
MYSQL_HOST: nonexistent.invalid.host
MYSQL_PORT: 3306
MYSQL_USER: invaliduser
Expand All @@ -83,7 +81,6 @@ jobs:
REAL_MYSQL_PASSWORD: testpass
REAL_MYSQL_DATABASE: testdb

# MariaDB - use truly invalid config for failure tests
MARIADB_HOST: nonexistent.invalid.host
MARIADB_PORT: 3307
MARIADB_USER: invaliduser
Expand All @@ -103,20 +100,20 @@ jobs:
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v2 # v4 doesn't exist, pinned to v2
with:
version: 9
version: 10 # aligned with release workflow

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
node-version: 22 # aligned with release workflow, not lts/*
cache: "pnpm"

- name: Install bridge dependencies
run: |
cd bridge
pnpm install --frozen-lockfile=false
pnpm install --frozen-lockfile # removed --frozen-lockfile=false

- name: Seed PostgreSQL database
run: |
Expand Down
17 changes: 8 additions & 9 deletions bridge/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "db-visualizer-bridge",
"name": "relwave-bridge",
"version": "0.4.0-beta.2",
"type": "commonjs",
"main": "dist/index.cjs",
Expand All @@ -8,8 +8,9 @@
"start": "node dist/index.cjs",
"build": "esbuild src/index.ts --bundle --platform=node --outfile=dist/index.cjs --format=cjs --packages=external",
"copy:native": "node scripts/copy-native.js",
"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",
"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",
"rebuild:native": "npm rebuild better-sqlite3",
"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",
"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",
"test": "jest",
"test:watch": "jest --watchAll --detectOpenHandles"
},
Expand All @@ -27,25 +28,23 @@
},
"bin": "./dist/index.cjs",
"pkg": {
"outputPath": "exece",
"targets": [
"node18-win-x64",
"node18-linux-x64"
"node22-win-x64",
"node22-linux-x64"
],
"assets": [
"node_modules/**/build/Release/*.node",
"node_modules/**/prebuilds/**/*",
"node_modules/@nut-tree/libnut-win32/build/Release/*"
"node_modules/**/prebuilds/**/*"
]
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.13",
"@types/jest": "^30.0.0",
"@types/node": "^20.0.0",
"@types/pg": "^8.15.6",
"@yao-pkg/pkg": "^5.12.0",
"esbuild": "^0.27.0",
"jest": "^30.2.0",
"pkg": "^5.8.1",
"ts-jest": "^29.4.6",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
Expand Down
Loading
Loading