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
25 changes: 21 additions & 4 deletions .github/workflows/release-tray.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ jobs:
- name: Prepare tray build assets
run: cp internal/geo/cities.json cmd/sap-devs-tray/data/cities.json

- name: Copy platform icon
shell: bash
run: |
if [ "${{ matrix.goos }}" = "windows" ]; then
cp cmd/sap-devs-tray/assets/icon.ico cmd/sap-devs-tray/sap-devs-tray.ico
elif [ "${{ matrix.goos }}" = "darwin" ]; then
cp cmd/sap-devs-tray/assets/icon.icns cmd/sap-devs-tray/icon.icns
else
cp cmd/sap-devs-tray/assets/icon.png cmd/sap-devs-tray/sap-devs-tray.png
fi

- name: Build
working-directory: cmd/sap-devs-tray
shell: bash
Expand All @@ -69,17 +80,23 @@ jobs:
CC: ${{ matrix.cc }}
run: |
EXT=""
if [ "${{ matrix.goos }}" = "windows" ]; then EXT=".exe"; fi
go build -ldflags "-X main.version=${VERSION}" -o "sap-devs-tray${EXT}" .
EXTRA_LDFLAGS=""
if [ "${{ matrix.goos }}" = "windows" ]; then
EXT=".exe"
EXTRA_LDFLAGS="-H windowsgui"
fi
go build -ldflags "-X main.version=${VERSION} ${EXTRA_LDFLAGS}" -o "sap-devs-tray${EXT}" .

- name: Package
shell: bash
run: |
ASSET="sap-devs-tray_${VERSION}_${{ matrix.goos }}_${{ matrix.goarch }}"
if [ "${{ matrix.goos }}" = "windows" ]; then
7z a "${ASSET}.zip" ./cmd/sap-devs-tray/sap-devs-tray.exe
7z a "${ASSET}.zip" ./cmd/sap-devs-tray/sap-devs-tray.exe ./cmd/sap-devs-tray/sap-devs-tray.ico
elif [ "${{ matrix.goos }}" = "darwin" ]; then
tar czf "${ASSET}.tar.gz" -C cmd/sap-devs-tray sap-devs-tray icon.icns
else
tar czf "${ASSET}.tar.gz" -C cmd/sap-devs-tray sap-devs-tray
tar czf "${ASSET}.tar.gz" -C cmd/sap-devs-tray sap-devs-tray sap-devs-tray.png
fi

- name: Generate checksum
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ On every command invocation (except `update` and dev builds), a background gorou

### Tray Companion (Experimental)

`internal/trayctl/` manages an optional GUI tray binary (`sap-devs-tray`) downloaded from GitHub Releases. `Manager` handles download, SHA256 checksum verification (via `tray-checksums.txt`), extraction (tar.gz/zip), start/stop (process management), and version-matched updates during `sap-devs update`. `autostart.go` provides cross-platform login startup registration: Windows registry (`HKCU\...\Run`), macOS LaunchAgent plist, Linux XDG `.desktop` file. The tray binary is stored at `~/.cache/sap-devs/bin/sap-devs-tray`. Config key: `config.Tray.Autostart`.
`internal/trayctl/` manages an optional GUI tray binary (`sap-devs-tray`) downloaded from GitHub Releases. `Manager` handles download, SHA256 checksum verification (via `tray-checksums.txt`), extraction (tar.gz/zip), start/stop (process management), and version-matched updates during `sap-devs update`. `autostart.go` provides cross-platform login startup registration: Windows registry (`HKCU\...\Run`), macOS LaunchAgent plist, Linux XDG `.desktop` file. The tray binary is stored at `~/.cache/sap-devs/bin/sap-devs-tray`. Config key: `config.Tray.Autostart`. `shortcut_windows.go` / `shortcut_darwin.go` / `shortcut_linux.go` handle native app shortcuts (Windows `.lnk`, macOS `.app` bundle, Linux `.desktop` files) — created during install, removed during uninstall. The release pipeline ships platform-specific icons alongside the binary and sets the Windows PE subsystem to GUI (`-H windowsgui`) to prevent terminal window allocation.

### Tray Binary (Optional)

Expand Down
7 changes: 7 additions & 0 deletions cmd/sap-devs-tray/assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Tray Icon Assets

- `icon.png` — 1024x1024 master PNG (source of truth)
- `icon.ico` — Windows ICO (multi-resolution: 16/32/48/256)
- `icon.icns` — macOS ICNS

Current files are placeholders. Replace with real assets before release.
Empty file.
Empty file.
Binary file added cmd/sap-devs-tray/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading