Skip to content

chore(build,ci): generate icon at build time, harden build.sh/Info.plist, and add macOS CI - #2

Merged
willtmc merged 1 commit into
mainfrom
chore/packaging-icon-cleanup-and-ci
Nov 25, 2026
Merged

willtmc merged 1 commit into
mainfrom
chore/packaging-icon-cleanup-and-ci

Conversation

@willtmc

@willtmc willtmc commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove tracked binary icon (Resources/TwoUp.icns) and generate build/TwoUp.icns on every build instead.
  • Modernize make_icon.swift: replace deprecated NSImage.lockFocus() with NSBitmapImageRep + NSGraphicsContext(bitmapImageRep:), guard CommandLine.arguments cleanly (no force-unwraps), render all iconset resolutions natively, and assemble .icns via iconutil (or write 1024×1024 .png when given a .png path). Passes swiftc -typecheck -swift-version 5 -warn-concurrency with zero warnings.
  • Harden build.sh:
    • Switch to #!/usr/bin/env bash so bash -n and shellcheck pass cleanly.
    • Add --build-only flag to build build/TwoUp.app without touching ~/Applications.
    • Support SIGN_IDENTITY env var (default - ad-hoc) and verify with codesign --verify --deep --strict.
    • Clean only build/TwoUp.app, build/TwoUp.icns, and build/TwoUp.iconset instead of rm -rf build.
    • Lint Info.plist with plutil -lint before packaging and auto-include Core.swift if present.
    • Create $HOME/Applications (mkdir -p) before installing so fresh Macs don't fail.
  • Update Info.plist: add NSAppTransportSecurity (NSAllowsArbitraryLoadsInWebContent = true) for plain http:// web content, plus CFBundleInfoDictionaryVersion (6.0), LSApplicationCategoryType (public.app-category.news), and NSHumanReadableCopyright.
  • Optimize docs/screenshot.png: palette-quantized via pngquant at 1800×1125 from 1,087,726 bytes to 354,269 bytes (−67.4%).
  • Update .gitignore: ensure build/, .DS_Store, .impeccable/, and .claude/ are ignored.
  • Add macOS CI (.github/workflows/ci.yml): runs bash -n, shellcheck -S error, plutil -lint Info.plist, swiftc -typecheck -swift-version 5 -warn-concurrency make_icon.swift, ./build.sh --build-only, codesign --verify --deep --strict, and verifies TwoUp.icns is bundled.

Verification

  • bash -n build.sh && shellcheck -S error build.sh — passed (0 errors, 0 warnings)
  • plutil -lint Info.plist — Info.plist: OK
  • swiftc -typecheck -swift-version 5 -warn-concurrency make_icon.swift — passed (0 warnings)
  • ./build.sh --build-only — built build/TwoUp.app, preserved unrelated files in build/
  • codesign --verify --deep --strict build/TwoUp.app — passed
  • build/TwoUp.app/Contents/Resources/TwoUp.icns — 88 KB, unpacked via iconutil confirming all 10 iconset sizes
  • swift make_icon.swift (no args) — exits 1 with usage message

@willtmc
willtmc merged commit 9f94fbb into main Nov 25, 2026
1 check passed
@willtmc
willtmc deleted the chore/packaging-icon-cleanup-and-ci branch November 25, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant