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
Binary file added .DS_Store
Binary file not shown.
77 changes: 59 additions & 18 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on:

jobs:
#run build first to populate caches
build:
name: Build binary
build-windows:
name: Build Windows binary
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -34,50 +34,91 @@ jobs:
with:
command: build
args: --workspace --all-targets --all-features --release



- name: Check for release
id: is-release
shell: bash
run: |
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
echo ::set-output name=IS_RELEASE::${IS_RELEASE}
- name: Artifact Hash
id: package
shell: bash
run: |
md5sum target/release/rust_cat.exe >> hashes.txt
sha256sum target/release/rust_cat.exe >> hashes.txt
cat hashes.txt
- name: Artifact upload

- name: Artifact upload (Windows)
uses: actions/upload-artifact@master
with:
name: rust_cat.exe
path: target/release/rust_cat.exe
- name: Hash upload



- name: Publish archives and packages (Windows)
uses: softprops/action-gh-release@v1
if: steps.is-release.outputs.IS_RELEASE
with:
files: |
target/release/rust_cat.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


# Create universal macOS app bundle
build-macos:
name: Create universal macOS app bundle
runs-on: macos-latest
if: github.event_name != 'pull_request' || github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run macOS build script
run: ./build_macos.sh

- name: Check for release
id: is-release
shell: bash
run: |
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
echo ::set-output name=IS_RELEASE::${IS_RELEASE}

- name: Upload universal app bundle
uses: actions/upload-artifact@master
with:
name: RustCat-universal.app.zip
path: RustCat-universal.app.zip

- name: Upload universal DMG
uses: actions/upload-artifact@master
with:
name: hashes.txt
path: hashes.txt
- name: Publish archives and packages
name: RustCat-universal.dmg
path: RustCat-universal.dmg

- name: Publish universal macOS release
uses: softprops/action-gh-release@v1
if: steps.is-release.outputs.IS_RELEASE
with:
files: |
target/release/rust_cat.exe
hashes.txt
RustCat-universal.app.zip
RustCat-universal.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Auto-approve Dependabot PRs if build succeeds
dependabot-auto-approve:
runs-on: windows-latest
needs: build
needs: [build-windows, build-macos]
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
steps:
- name: Auto-approve PR
uses: hmarr/auto-approve-action@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge
run: |
gh pr merge --auto --squash "${{ github.event.pull_request.number }}"
Expand Down
28 changes: 27 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
/target
.claude
.claude

# macOS build artifacts
*.app
*.dmg
*.app.zip
*-universal.app
*-universal.dmg
*-universal.app.zip
rust_cat_universal
*.icns
*.iconset/

# macOS system files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Build artifacts
RustCat.app/
RustCat-*.app/
RustCat-*.dmg
RustCat-*.app.zip
23 changes: 18 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,26 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project Overview

RustCat is a Windows tray application that displays an animated cat or parrot icon whose animation speed reflects real-time CPU usage. It's a Rust port of RunCat_for_windows, removing the .NET runtime dependency.
RustCat is a cross-platform tray application that displays an animated cat or parrot icon whose animation speed reflects real-time CPU usage. Originally a Windows-only Rust port of RunCat_for_windows, it now supports both Windows and macOS.

## Build and Development Commands

### Building
```bash
# In WSL, use cargo.exe to build Windows binaries
# Windows (In WSL, use cargo.exe to build Windows binaries)
cargo.exe build --release

# macOS
cargo build --release
```

### Running (Development)
```bash
# In WSL, use cargo.exe to run Windows binaries
# Windows (In WSL, use cargo.exe to run Windows binaries)
cargo.exe run

# macOS
cargo run
```

### Testing
Expand Down Expand Up @@ -69,12 +75,19 @@ Icons are organized in `assets/` directory:

### Platform Specifics

- Windows-only application using Windows API extensively via windows-rs crate
#### Windows
- Uses Windows API extensively via windows-rs crate
- Uses Windows subsystem (no console window in release builds)
- Integrates with Windows registry for settings and startup behavior
- Requires Windows for tray icon functionality and CPU monitoring
- When developing in WSL, use `cargo.exe` instead of `cargo` to build Windows binaries

#### macOS
- Uses macOS NSApplication for proper integration
- Uses macOS defaults command for settings persistence
- Uses macOS LaunchAgents for startup behavior
- Detects system dark/light theme automatically
- Opens Activity Monitor instead of Task Manager

## Development Environment Notes

- When running in WSL, use `cargo.exe` to build
Loading
Loading