Skip to content
Draft
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
112 changes: 112 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Build and Release

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
publish:
description: 'Publish release to GitHub'
required: false
default: false
type: boolean

jobs:
build-macos:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install

- name: Build and package
run: pnpm build:release --mac
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# macOS code signing (optional - remove if not signing)
# CSC_LINK: ${{ secrets.MAC_CERTIFICATE }}
# CSC_KEY_PASSWORD: ${{ secrets.MAC_CERTIFICATE_PASSWORD }}
# Notarization (optional - remove if not notarizing)
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}

- name: Upload macOS artifacts
uses: actions/upload-artifact@v4
with:
name: release-macos
path: |
release/*.dmg
release/*.zip
if-no-files-found: warn

build-windows:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install

- name: Build and package
run: pnpm build:release --win
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: release-windows
path: |
release/*.exe
if-no-files-found: warn

release:
needs: [build-macos, build-windows]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.publish)
permissions:
contents: write

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true

- name: List artifacts
run: ls -la artifacts/

- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*
generate_release_notes: true
draft: ${{ github.event_name == 'workflow_dispatch' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Binary file added build/icon.ico
Binary file not shown.
16 changes: 16 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ mac:
entitlementsInherit: build/entitlements.mac.plist
notarize: true

win:
artifactName: "Chroma-Explorer-${version}-${arch}-win.${ext}"
target:
- target: nsis
arch:
- x64
- target: portable
arch:
- x64
icon: build/icon.ico

nsis:
oneClick: false
allowToChangeInstallationDirectory: true
deleteAppDataOnUninstall: false

dmg:
artifactName: "Chroma-Explorer-${version}-${arch}.${ext}"
sign: false
Expand Down
30 changes: 18 additions & 12 deletions electron/window-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ import { randomUUID } from 'crypto'
import { settingsStore } from './settings-store'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
const isMac = process.platform === 'darwin'

/**
* Get macOS-specific window options (vibrancy, hidden title bar)
* These options are only applied on macOS; on other platforms they're omitted
*/
function getMacOSWindowOptions(): Partial<Electron.BrowserWindowConstructorOptions> {
if (!isMac) return {}
return {
titleBarStyle: 'hiddenInset',
transparent: true,
vibrancy: 'under-window',
visualEffectState: 'active',
}
}

/**
* Get the appropriate background color based on theme setting
Expand Down Expand Up @@ -92,13 +107,10 @@ class WindowManager {
resizable: false,
minimizable: false,
maximizable: false,
titleBarStyle: 'hiddenInset',
title: 'Chroma Explorer - Setup',
center: true,
transparent: true,
vibrancy: 'under-window',
visualEffectState: 'active',
backgroundColor: getThemeBackgroundColor(),
...getMacOSWindowOptions(),
webPreferences: {
preload: path.join(__dirname, 'preload.mjs'),
contextIsolation: true,
Expand Down Expand Up @@ -150,13 +162,10 @@ class WindowManager {
resizable: true,
minimizable: true,
maximizable: false,
titleBarStyle: 'hiddenInset',
title: 'Settings',
center: true,
transparent: true,
vibrancy: 'under-window',
visualEffectState: 'active',
backgroundColor: getThemeBackgroundColor(),
...getMacOSWindowOptions(),
webPreferences: {
preload: path.join(__dirname, 'preload.mjs'),
contextIsolation: true,
Expand Down Expand Up @@ -222,12 +231,9 @@ class WindowManager {
height: 800,
x: 100 + offset,
y: 100 + offset,
titleBarStyle: 'hiddenInset',
title: `Chroma Explorer - ${profile.name}`,
transparent: true,
vibrancy: 'under-window',
visualEffectState: 'active',
backgroundColor: getThemeBackgroundColor(),
...getMacOSWindowOptions(),
webPreferences: {
preload: path.join(__dirname, 'preload.mjs'),
contextIsolation: true,
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"build": "vite build && electron-builder --dir",
"build:release": "vite build && electron-builder",
"preview": "vite preview",
"postinstall": "electron-builder install-app-deps"
"postinstall": "node scripts/postinstall.mjs"
},
"keywords": [
"electron",
Expand Down Expand Up @@ -82,7 +82,6 @@
"@radix-ui/react-slot": "^1.2.4",
"@tanstack/react-query": "^5.90.16",
"@tanstack/react-table": "^8.21.3",
"bufferutil": "^4.1.0",
"chromadb": "^3.2.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
Expand All @@ -96,7 +95,6 @@
"react-dom": "^19.2.3",
"react-resizable-panels": "^4.3.2",
"sharp": "^0.34.5",
"tailwind-merge": "^3.4.0",
"utf-8-validate": "^6.0.6"
"tailwind-merge": "^3.4.0"
}
}
Loading