Skip to content

Commit 19ae500

Browse files
committed
test
1 parent ba5e1f0 commit 19ae500

File tree

6 files changed

+196
-2
lines changed

6 files changed

+196
-2
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# macOS Build Workflow Secrets
2+
3+
This workflow requires the following GitHub secrets to be configured:
4+
5+
## Required Secrets
6+
7+
### 1. `APPLE_CERTIFICATE`
8+
- **Description**: Base64-encoded Developer ID Application certificate (.p12 file)
9+
- **How to obtain**:
10+
```bash
11+
# Export certificate from Keychain Access as .p12
12+
# Then encode it:
13+
base64 -i certificate.p12 -o certificate_base64.txt
14+
```
15+
- **Example**: `MIIKqQ...` (very long base64 string)
16+
17+
### 2. `APPLE_CERTIFICATE_PASSWORD`
18+
- **Description**: Password used when exporting the .p12 certificate
19+
- **Example**: `mySecurePassword123`
20+
21+
### 3. `APPLE_SIGNING_IDENTITY`
22+
- **Description**: The signing identity string from your certificate
23+
- **Format**: `Developer ID Application: Your Name (TEAM_ID)`
24+
- **Example**: `Developer ID Application: Kiran Johns (Z432G66FRM)`
25+
- **How to find**:
26+
```bash
27+
security find-identity -v -p codesigning
28+
```
29+
30+
### 4. `APPLE_ID`
31+
- **Description**: Your Apple ID email used for notarization
32+
- **Example**: `developer@example.com`
33+
34+
### 5. `APPLE_TEAM_ID`
35+
- **Description**: Your Apple Developer Team ID
36+
- **Example**: `Z432G66FRM`
37+
- **Where to find**: Apple Developer portal → Membership → Team ID
38+
39+
### 6. `APPLE_PASSWORD`
40+
- **Description**: App-specific password for notarization (NOT your Apple ID password)
41+
- **How to create**:
42+
1. Go to https://appleid.apple.com
43+
2. Sign in and go to "App-Specific Passwords"
44+
3. Generate a new password for "Claudia Notarization"
45+
- **Example**: `abcd-efgh-ijkl-mnop`
46+
47+
### 7. `KEYCHAIN_PASSWORD`
48+
- **Description**: A password for the temporary keychain (can be any secure password)
49+
- **Example**: `tempKeychainPass123!`
50+
- **Note**: This is only used during the build process
51+
52+
## Setting up Secrets in GitHub
53+
54+
1. Go to your repository on GitHub
55+
2. Navigate to Settings → Secrets and variables → Actions
56+
3. Click "New repository secret"
57+
4. Add each secret with the exact name and value
58+
59+
## Testing the Workflow
60+
61+
The workflow will trigger on:
62+
- Manual dispatch (Actions tab → Build macOS → Run workflow)
63+
- Pushes to `main` or `test-macos-workflow` branches
64+
65+
## Artifacts
66+
67+
The workflow produces:
68+
- `Claudia.dmg` - Signed and notarized installer
69+
- `Claudia.app.zip` - The universal app bundle
70+
- `checksums.txt` - SHA256 checksums for verification

.github/workflows/build-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build macOS
33
on:
44
workflow_dispatch:
55
push:
6-
branches: [main, test-macos-workflow]
6+
branches: [main, test-linux-workflow]
77

88
jobs:
99
build:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ CLAUDE.md
3737
.claude/
3838

3939
.env
40-
sign.sh
40+
build-macos.sh

Casks/claudia.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
cask "claudia" do
2+
version "0.1.0"
3+
sha256 "634de48313b312401d1132a29e2a604c7d17ff41f07763985237563067143228"
4+
5+
url "https://github.com/getasterisk/claudia/releases/download/v#{version}/Claudia-#{version}.dmg"
6+
name "Claudia"
7+
desc "GUI app and Toolkit for Claude Code"
8+
homepage "https://github.com/getasterisk/claudia"
9+
10+
livecheck do
11+
url :url
12+
strategy :github_latest
13+
end
14+
15+
depends_on macos: ">= :catalina"
16+
17+
app "Claudia.app"
18+
19+
zap trash: [
20+
"~/Library/Application Support/claudia.asterisk.so",
21+
"~/Library/Caches/claudia.asterisk.so",
22+
"~/Library/Preferences/claudia.asterisk.so.plist",
23+
"~/Library/Saved Application State/claudia.asterisk.so.savedState",
24+
"~/Library/WebKit/claudia.asterisk.so",
25+
]
26+
end

Claudia.dmg

22.2 MB
Binary file not shown.

Makefile

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Makefile for Claudia - Homebrew distribution
2+
3+
# Variables
4+
VERSION := $(shell grep '^version' src-tauri/Cargo.toml | head -1 | cut -d'"' -f2)
5+
DIST_NAME := Claudia-$(VERSION)-darwin
6+
BUILD_DIR := src-tauri/target/universal-apple-darwin/release/bundle
7+
8+
# Phony targets
9+
.PHONY: all clean build release cask test sign notarize help deps
10+
11+
# Default target
12+
all: build
13+
14+
# Help target
15+
help:
16+
@echo "Claudia Homebrew Build System"
17+
@echo "=============================="
18+
@echo "Available targets:"
19+
@echo " make build - Build the application for macOS (creates DMG)"
20+
@echo " make release - Create a release DMG for Homebrew"
21+
@echo " make cask - Update the Homebrew cask with latest SHA"
22+
@echo " make test - Test the Homebrew cask locally"
23+
@echo " make sign - Sign the application (requires Developer ID)"
24+
@echo " make notarize - Notarize the application (requires Apple account)"
25+
@echo " make clean - Clean build artifacts"
26+
@echo " make help - Show this help message"
27+
28+
# Clean build artifacts
29+
clean:
30+
@echo "Cleaning build artifacts..."
31+
rm -rf dist
32+
rm -rf src-tauri/target/release/bundle
33+
rm -rf src-tauri/target/universal-apple-darwin/release/bundle
34+
rm -f *.dmg
35+
36+
# Install dependencies
37+
deps:
38+
@echo "Installing dependencies..."
39+
bun install
40+
cd src-tauri && cargo fetch
41+
42+
# Build the application
43+
build: deps
44+
@echo "Building Claudia v$(VERSION)..."
45+
@echo "Note: Use './sign.sh' to build a universal binary with proper signing"
46+
@echo "Building for current architecture only..."
47+
bun run build
48+
cd src-tauri && cargo tauri build
49+
50+
# Create release DMG
51+
release: build
52+
@echo "Creating release DMG..."
53+
@if [ -f "$(BUILD_DIR)/dmg/Claudia.dmg" ]; then \
54+
cp "$(BUILD_DIR)/dmg/Claudia.dmg" "Claudia-$(VERSION).dmg"; \
55+
echo "DMG created: Claudia-$(VERSION).dmg"; \
56+
echo "SHA256: $$(shasum -a 256 Claudia-$(VERSION).dmg | awk '{print $$1}')"; \
57+
else \
58+
echo "Error: DMG not found. Make sure 'dmg' is in your tauri.conf.json targets."; \
59+
exit 1; \
60+
fi
61+
62+
# Update cask with current SHA
63+
cask: release
64+
$(eval SHA256 := $(shell shasum -a 256 Claudia-$(VERSION).dmg | awk '{print $$1}'))
65+
@echo "Updating cask with SHA256: $(SHA256)"
66+
@sed -i '' "s/sha256 \".*\"/sha256 \"$(SHA256)\"/" Casks/claudia.rb
67+
@sed -i '' "s/version \".*\"/version \"$(VERSION)\"/" Casks/claudia.rb
68+
@echo "Cask updated!"
69+
70+
# Test the cask locally
71+
test:
72+
@echo "Testing Homebrew cask..."
73+
export HOMEBREW_NO_AUTO_UPDATE=1 && \
74+
export HOMEBREW_NO_INSTALL_FROM_API=1 && \
75+
brew install --cask Casks/claudia.rb
76+
brew audit --new --cask claudia
77+
brew style --fix Casks/claudia.rb
78+
79+
# Sign the application (requires Apple Developer certificate)
80+
sign:
81+
@echo "Signing application..."
82+
@echo "Note: This requires a valid Apple Developer ID certificate"
83+
codesign --deep --force --verify --verbose --sign "Developer ID Application: YOUR NAME (TEAM_ID)" \
84+
--options runtime \
85+
--entitlements src-tauri/entitlements.plist \
86+
$(BUILD_DIR)/macos/Claudia.app
87+
88+
# Notarize the application (requires Apple Developer account)
89+
notarize: sign
90+
@echo "Notarizing application..."
91+
@echo "Creating ZIP for notarization..."
92+
cd $(BUILD_DIR)/macos && zip -r Claudia.zip Claudia.app
93+
xcrun notarytool submit $(BUILD_DIR)/macos/Claudia.zip \
94+
--apple-id "YOUR_APPLE_ID" \
95+
--team-id "YOUR_TEAM_ID" \
96+
--password "YOUR_APP_PASSWORD" \
97+
--wait
98+
xcrun stapler staple $(BUILD_DIR)/macos/Claudia.app

0 commit comments

Comments
 (0)