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

on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
build:
strategy:
matrix:
include:
- os: macos-latest
platform: mac
- os: ubuntu-latest
platform: linux

runs-on: ${{ matrix.os }}

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 Linux dependencies
if: matrix.platform == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y libsecret-1-dev libx11-dev libxss-dev

- name: Install dependencies
run: pnpm install

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

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.platform }}
path: |
dist/*.dmg
dist/*.zip
dist/*.AppImage
dist/*.deb
if-no-files-found: ignore

release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write

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

- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
"zip"
]
},
"linux": {
"category": "Development",
"icon": "build/icon.png",
"target": [
"AppImage",
"deb"
]
},
"directories": {
"output": "dist"
},
Expand Down