Skip to content

Commit 95c4dcf

Browse files
Prot10claude
andcommitted
docs: update release script and documentation
- Use certificate SHA-1 instead of name to avoid ambiguity - Add validation for required environment variables - Update CLAUDE.md with release process documentation - Update .env.example with new configuration format Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bb0cc3f commit 95c4dcf

File tree

3 files changed

+58
-5
lines changed

3 files changed

+58
-5
lines changed

.env.example

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ APPLE_ID=your-apple-id@email.com
33
APPLE_APP_SPECIFIC_PASSWORD=xxxx-xxxx-xxxx-xxxx
44
APPLE_TEAM_ID=XXXXXXXXXX
55

6-
# Certificate name (from Keychain Access)
7-
MACOS_CERTIFICATE_NAME="Developer ID Application: Your Name (XXXXXXXXXX)"
6+
# Certificate SHA-1 hash (from: security find-identity -v -p codesigning)
7+
# Use SHA-1 instead of name to avoid ambiguity with duplicate certificates
8+
MACOS_CERTIFICATE_SHA1=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
89

910
# Sparkle EdDSA private key (base64)
1011
SPARKLE_PRIVATE_KEY=your-sparkle-private-key-here

CLAUDE.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| Target | macOS 14.0+ (Sonoma) |
1212
| Design | Liquid Glass (native on macOS 26+, material fallback on 14-15) |
1313
| Architecture | MVVM with Swift actors for services |
14-
| Status | Complete (v1.0.0 released) |
14+
| Status | Beta (v0.1.x) |
1515

1616
## Features
1717

@@ -76,6 +76,41 @@ xcodebuild -project MyMacCleaner.xcodeproj -scheme MyMacCleaner build
7676
xcodebuild test -project MyMacCleaner.xcodeproj -scheme MyMacCleaner
7777
```
7878

79+
## Release Process
80+
81+
The release script automates the complete release workflow:
82+
83+
```bash
84+
./scripts/release.sh <version> "<changelog>"
85+
# Example: ./scripts/release.sh 0.1.1 "Fixed bug in file scanner"
86+
```
87+
88+
### What the script does:
89+
1. Updates version in Xcode project (version string + build number)
90+
2. Builds and archives the app
91+
3. Signs with Developer ID certificate
92+
4. Notarizes with Apple (app + DMG)
93+
5. Creates DMG and ZIP packages
94+
6. Signs ZIP for Sparkle auto-updates
95+
7. Updates `appcast.xml` and `website/public/data/releases.json`
96+
8. Creates GitHub release with assets
97+
9. Commits and pushes all changes
98+
99+
### Prerequisites:
100+
1. Copy `.env.example` to `.env` and fill in credentials
101+
2. Set up notarization profile: `xcrun notarytool store-credentials "notary-profile" --apple-id YOUR_APPLE_ID --team-id YOUR_TEAM_ID`
102+
3. Authenticate gh CLI: `gh auth login`
103+
4. Find certificate SHA-1: `security find-identity -v -p codesigning`
104+
105+
### Environment Variables (.env):
106+
| Variable | Description |
107+
|----------|-------------|
108+
| `APPLE_ID` | Apple Developer email |
109+
| `APPLE_APP_SPECIFIC_PASSWORD` | App-specific password for notarization |
110+
| `APPLE_TEAM_ID` | 10-character Team ID |
111+
| `MACOS_CERTIFICATE_SHA1` | 40-character SHA-1 hash of signing certificate |
112+
| `SPARKLE_PRIVATE_KEY` | Base64 EdDSA private key for Sparkle updates |
113+
79114
## Dependencies
80115

81116
| Package | Purpose |

scripts/release.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@ else
4444
exit 1
4545
fi
4646

47+
# Validate required environment variables
48+
if [ -z "$MACOS_CERTIFICATE_SHA1" ]; then
49+
echo -e "${RED}Error: MACOS_CERTIFICATE_SHA1 not set in .env${NC}"
50+
echo "Run 'security find-identity -v -p codesigning' to find your certificate SHA-1"
51+
exit 1
52+
fi
53+
54+
if [ -z "$APPLE_TEAM_ID" ]; then
55+
echo -e "${RED}Error: APPLE_TEAM_ID not set in .env${NC}"
56+
exit 1
57+
fi
58+
59+
if [ -z "$SPARKLE_PRIVATE_KEY" ]; then
60+
echo -e "${RED}Error: SPARKLE_PRIVATE_KEY not set in .env${NC}"
61+
exit 1
62+
fi
63+
4764
# Configuration
4865
APP_NAME="MyMacCleaner"
4966
SCHEME="MyMacCleaner"
@@ -103,7 +120,7 @@ xcodebuild archive \
103120
-scheme "${SCHEME}" \
104121
-archivePath "build/${APP_NAME}.xcarchive" \
105122
-configuration Release \
106-
CODE_SIGN_IDENTITY="${MACOS_CERTIFICATE_NAME}" \
123+
CODE_SIGN_IDENTITY="${MACOS_CERTIFICATE_SHA1}" \
107124
DEVELOPMENT_TEAM="${APPLE_TEAM_ID}" \
108125
CODE_SIGN_STYLE=Manual \
109126
OTHER_CODE_SIGN_FLAGS="--options runtime --timestamp" \
@@ -199,7 +216,7 @@ echo -e "${GREEN}DMG created successfully${NC}"
199216
echo ""
200217
echo -e "${YELLOW}[6/10] Signing and notarizing DMG...${NC}"
201218

202-
codesign --force --sign "${MACOS_CERTIFICATE_NAME}" \
219+
codesign --force --sign "${MACOS_CERTIFICATE_SHA1}" \
203220
--options runtime --timestamp \
204221
"build/${APP_NAME}-v${VERSION}.dmg"
205222

0 commit comments

Comments
 (0)