Skip to content
Open
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
75 changes: 75 additions & 0 deletions .github/workflows/build-intel-dmg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build Intel DMG

on:
push:
branches:
- codex/intel-x86_64-macos14
workflow_dispatch:

jobs:
build-intel:
runs-on: macos-15
timeout-minutes: 45

steps:
- uses: actions/checkout@v4

- name: Confirm Xcode toolchain
run: |
uname -m
xcodebuild -version

- name: Build Intel app
run: |
xcodebuild \
-project Dayflow/Dayflow.xcodeproj \
-scheme Dayflow \
-configuration Release \
-derivedDataPath build \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
ARCHS=x86_64 \
ONLY_ACTIVE_ARCH=YES \
build

- name: Verify, sign, and package
run: |
set -euo pipefail
APP="build/Build/Products/Release/Dayflow.app"
MAIN="$APP/Contents/MacOS/Dayflow"
test -d "$APP"
lipo "$MAIN" -verify_arch x86_64

while IFS= read -r -d '' binary; do
if file "$binary" | grep -q 'Mach-O'; then
echo "Checking $binary"
lipo "$binary" -verify_arch x86_64
fi
done < <(find "$APP/Contents" -type f -perm -111 -print0)

codesign --force --deep --sign - \
--entitlements Dayflow/Dayflow/Dayflow.entitlements \
"$APP"
codesign --verify --deep --strict --verbose=2 "$APP"

mkdir -p dist/dmg-root
ditto "$APP" "dist/dmg-root/Dayflow.app"
ln -s /Applications "dist/dmg-root/Applications"
hdiutil create \
-volname "Dayflow Intel" \
-srcfolder "dist/dmg-root" \
-ov \
-format UDZO \
"dist/Dayflow-2.1.1-Intel.dmg"
shasum -a 256 "dist/Dayflow-2.1.1-Intel.dmg" \
> "dist/Dayflow-2.1.1-Intel.dmg.sha256"

- uses: actions/upload-artifact@v4
with:
name: Dayflow-2.1.1-Intel
path: |
dist/Dayflow-2.1.1-Intel.dmg
dist/Dayflow-2.1.1-Intel.dmg.sha256
if-no-files-found: error
retention-days: 30
2 changes: 2 additions & 0 deletions Dayflow/Dayflow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = C4DF00012EFB100000000001 /* Config/Dayflow.xcconfig */;
buildSettings = {
ARCHS = x86_64;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
Expand Down Expand Up @@ -468,6 +469,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = C4DF00012EFB100000000001 /* Config/Dayflow.xcconfig */;
buildSettings = {
ARCHS = x86_64;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
Expand Down
41 changes: 24 additions & 17 deletions scripts/release_dmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ set -euo pipefail
# ASC_KEY_ID - App Store Connect API key ID (optional)
# ASC_ISSUER_ID - App Store Connect Issuer ID (optional)
# ASC_P8_PATH - Path to .p8 private key (optional)
# ARCHS - Architecture to build (default: x86_64 for Intel Macs)

# Load optional per-developer config
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
Expand All @@ -37,6 +38,7 @@ APP_NAME=${APP_NAME:-Dayflow}
ENTITLEMENTS=${ENTITLEMENTS:-Dayflow/Dayflow/Dayflow.entitlements}
VOL_NAME=${VOL_NAME:-$APP_NAME}
DMG_NAME=${DMG_NAME:-"${APP_NAME}.dmg"}
ARCHS=${ARCHS:-x86_64}

APP_PATH="${DERIVED_DATA}/Build/Products/${CONFIG}/${APP_NAME}.app"
# Work in a non-iCloud temporary directory to avoid fileprovider xattrs
Expand All @@ -60,6 +62,8 @@ xcodebuild \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
ARCHS="${ARCHS}" \
ONLY_ACTIVE_ARCH=YES \
build

if [[ ! -d "${APP_PATH}" ]]; then
Expand Down Expand Up @@ -237,13 +241,7 @@ echo "[6/8] Verifying signature…"
codesign --verify --deep --strict --verbose=2 "${SANITIZED_APP}"
spctl -a -vvv --type execute "${SANITIZED_APP}" || true

echo "[7/8] Creating DMG with create-dmg…"
# Require create-dmg for reliable DMG styling
if ! command -v create-dmg >/dev/null 2>&1; then
echo "ERROR: create-dmg is required but not installed." >&2
echo " Install it with: brew install create-dmg" >&2
exit 1
fi
echo "[7/8] Creating DMG…"

# Default to project's background image
SCRIPT_PARENT=$(cd "$SCRIPT_DIR/.." && pwd)
Expand All @@ -259,16 +257,25 @@ rm -f "${DMG_NAME}"

# Window size and positions tuned for docs/assets/dmg-background.png (1550×960 @2x, displays as 775×480)
# Dayflow app on left, Applications folder on right (swapped from typical layout)
create-dmg \
--volname "${VOL_NAME}" \
--background "${DMG_BG}" \
--window-size 775 480 \
--icon-size "${DMG_ICON_SIZE:-128}" \
--icon "${APP_NAME}.app" 200 270 \
--app-drop-link 575 270 \
--no-internet-enable \
"${DMG_NAME}" \
"${SANITIZED_APP}"
if command -v create-dmg >/dev/null 2>&1; then
create-dmg \
--volname "${VOL_NAME}" \
--background "${DMG_BG}" \
--window-size 775 480 \
--icon-size "${DMG_ICON_SIZE:-128}" \
--icon "${APP_NAME}.app" 200 270 \
--app-drop-link 575 270 \
--no-internet-enable \
"${DMG_NAME}" \
"${SANITIZED_APP}"
else
echo "create-dmg not found; using hdiutil fallback (basic installer layout)."
STAGING_DIR="${SANITIZED_DIR}/dmg-staging"
mkdir -p "${STAGING_DIR}"
ditto "${SANITIZED_APP}" "${STAGING_DIR}/${APP_NAME}.app"
ln -s /Applications "${STAGING_DIR}/Applications"
hdiutil create -volname "${VOL_NAME}" -srcfolder "${STAGING_DIR}" -ov -format UDZO "${DMG_NAME}"
fi

echo "[8/8] Submitting DMG for notarization…"
NOTARY_ARGS=("${DMG_NAME}")
Expand Down