2 Commits

Author SHA1 Message Date
Micha
00978b096b Add custom app icon and improved DMG layout 2025-11-20 20:55:14 +01:00
Micha
73d81216bb Support codesign/notarize via local credentials file 2025-11-20 00:34:56 +01:00
16 changed files with 55 additions and 4 deletions

2
.gitignore vendored
View File

@@ -3,3 +3,5 @@ xcuserdata/
DerivedData/ DerivedData/
build/ build/
Build/ Build/
dist/
.signing.env

View File

@@ -1,51 +1,61 @@
{ {
"images" : [ "images" : [
{ {
"filename" : "icon_16x16.png",
"idiom" : "mac", "idiom" : "mac",
"scale" : "1x", "scale" : "1x",
"size" : "16x16" "size" : "16x16"
}, },
{ {
"filename" : "icon_16x16@2x.png",
"idiom" : "mac", "idiom" : "mac",
"scale" : "2x", "scale" : "2x",
"size" : "16x16" "size" : "16x16"
}, },
{ {
"filename" : "icon_32x32.png",
"idiom" : "mac", "idiom" : "mac",
"scale" : "1x", "scale" : "1x",
"size" : "32x32" "size" : "32x32"
}, },
{ {
"filename" : "icon_32x32@2x.png",
"idiom" : "mac", "idiom" : "mac",
"scale" : "2x", "scale" : "2x",
"size" : "32x32" "size" : "32x32"
}, },
{ {
"filename" : "icon_128x128.png",
"idiom" : "mac", "idiom" : "mac",
"scale" : "1x", "scale" : "1x",
"size" : "128x128" "size" : "128x128"
}, },
{ {
"filename" : "icon_128x128@2x.png",
"idiom" : "mac", "idiom" : "mac",
"scale" : "2x", "scale" : "2x",
"size" : "128x128" "size" : "128x128"
}, },
{ {
"filename" : "icon_256x256.png",
"idiom" : "mac", "idiom" : "mac",
"scale" : "1x", "scale" : "1x",
"size" : "256x256" "size" : "256x256"
}, },
{ {
"filename" : "icon_256x256@2x.png",
"idiom" : "mac", "idiom" : "mac",
"scale" : "2x", "scale" : "2x",
"size" : "256x256" "size" : "256x256"
}, },
{ {
"filename" : "icon_512x512.png",
"idiom" : "mac", "idiom" : "mac",
"scale" : "1x", "scale" : "1x",
"size" : "512x512" "size" : "512x512"
}, },
{ {
"filename" : "icon_512x512@2x.png",
"idiom" : "mac", "idiom" : "mac",
"scale" : "2x", "scale" : "2x",
"size" : "512x512" "size" : "512x512"

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
Assets/dmg_background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -39,13 +39,13 @@ open iKeyMon.xcodeproj
### Local release build ### Local release build
Use the helper script to produce a zipped `.app` in `dist/`: Use the helper script to produce distributables in `dist/`:
```bash ```bash
./scripts/build_release.sh ./scripts/build_release.sh
``` ```
It cleans previous artifacts, builds the `Release` configuration, and drops `iKeyMon-<version>.zip` into the `dist` folder (ignored by git). It cleans previous artifacts, builds the `Release` configuration, and drops both `iKeyMon-<version>.zip` and `iKeyMon-<version>.dmg` into the `dist` folder (ignored by git). To enable codesigning + notarization, copy `signing.env.example` to `.signing.env`, fill in your Developer ID identity, Apple ID, team ID, and app-specific password. The script sources that file locally (it remains gitignored) and performs signing/notarization when the values are present.
## 📦 License ## 📦 License
MIT — see [LICENSE](LICENSE) for details. MIT — see [LICENSE](LICENSE) for details.

View File

@@ -6,6 +6,12 @@ BUILD_DIR="$ROOT_DIR/build"
ARTIFACTS_DIR="$ROOT_DIR/dist" ARTIFACTS_DIR="$ROOT_DIR/dist"
SCHEME="iKeyMon" SCHEME="iKeyMon"
PROJECT="iKeyMon.xcodeproj" PROJECT="iKeyMon.xcodeproj"
CREDENTIALS_FILE="$ROOT_DIR/.signing.env"
if [[ -f "$CREDENTIALS_FILE" ]]; then
# shellcheck disable=SC1090
source "$CREDENTIALS_FILE"
fi
rm -rf "$BUILD_DIR" "$ARTIFACTS_DIR" rm -rf "$BUILD_DIR" "$ARTIFACTS_DIR"
mkdir -p "$ARTIFACTS_DIR" mkdir -p "$ARTIFACTS_DIR"
@@ -23,6 +29,20 @@ if [[ ! -d "$APP_PATH" ]]; then
exit 1 exit 1
fi fi
STAGING_DIR=$(mktemp -d)
mkdir -p "$STAGING_DIR"
cp -R "$APP_PATH" "$STAGING_DIR/"
ln -s /Applications "$STAGING_DIR/Applications"
mkdir -p "$STAGING_DIR/.background"
cp "$ROOT_DIR/Assets/dmg_background.png" "$STAGING_DIR/.background/background.png"
if [[ -n "${CODESIGN_IDENTITY:-}" ]]; then
echo "🔏 Codesigning app with identity: $CODESIGN_IDENTITY"
codesign --deep --force --options runtime --sign "$CODESIGN_IDENTITY" "$APP_PATH"
else
echo "⚠️ Skipping codesign (CODESIGN_IDENTITY not set)."
fi
VERSION=$(xcodebuild \ VERSION=$(xcodebuild \
-project "$ROOT_DIR/$PROJECT" \ -project "$ROOT_DIR/$PROJECT" \
-scheme "$SCHEME" \ -scheme "$SCHEME" \
@@ -37,6 +57,21 @@ zip -r "$ARTIFACTS_DIR/$ZIP_NAME" "$(basename "$APP_PATH")"
popd >/dev/null popd >/dev/null
DMG_NAME="iKeyMon-${VERSION}.dmg" DMG_NAME="iKeyMon-${VERSION}.dmg"
hdiutil create -volname "iKeyMon" -srcfolder "$APP_PATH" -ov -format UDZO "$ARTIFACTS_DIR/$DMG_NAME" hdiutil create -volname "iKeyMon" -srcfolder "$STAGING_DIR" -ov -format UDZO "$ARTIFACTS_DIR/$DMG_NAME"
echo "✅ Build complete. Artifact: $ARTIFACTS_DIR/$ZIP_NAME" if [[ -n "${NOTARY_APPLE_ID:-}" && -n "${NOTARY_TEAM_ID:-}" && -n "${NOTARY_PASSWORD:-}" ]]; then
echo "📝 Submitting DMG for notarization..."
xcrun notarytool submit "$ARTIFACTS_DIR/$DMG_NAME" \
--apple-id "$NOTARY_APPLE_ID" \
--team-id "$NOTARY_TEAM_ID" \
--password "$NOTARY_PASSWORD" \
--wait
xcrun stapler staple "$ARTIFACTS_DIR/$DMG_NAME"
else
echo "⚠️ Skipping notarization (NOTARY_* variables not set)."
fi
rm -rf "$STAGING_DIR"
echo "✅ Build complete. Artifacts:"
echo " - $ARTIFACTS_DIR/$ZIP_NAME"
echo " - $ARTIFACTS_DIR/$DMG_NAME"

4
signing.env.example Normal file
View File

@@ -0,0 +1,4 @@
CODESIGN_IDENTITY="Developer ID Application: Your Name (TEAMID1234)"
NOTARY_APPLE_ID="appleid@example.com"
NOTARY_TEAM_ID="TEAMID1234"
NOTARY_PASSWORD="app-specific-password"