Repository navigation
chore(build,ci): generate icon at build time, harden build.sh/Info.plist, and add macOS CI - #2
Merged
Merged
Conversation
…ist, and add macOS CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resources/TwoUp.icns) and generatebuild/TwoUp.icnson every build instead.make_icon.swift: replace deprecatedNSImage.lockFocus()withNSBitmapImageRep+NSGraphicsContext(bitmapImageRep:), guardCommandLine.argumentscleanly (no force-unwraps), render all iconset resolutions natively, and assemble.icnsviaiconutil(or write 1024×1024.pngwhen given a.pngpath). Passesswiftc -typecheck -swift-version 5 -warn-concurrencywith zero warnings.build.sh:#!/usr/bin/env bashsobash -nandshellcheckpass cleanly.--build-onlyflag to buildbuild/TwoUp.appwithout touching~/Applications.SIGN_IDENTITYenv var (default-ad-hoc) and verify withcodesign --verify --deep --strict.build/TwoUp.app,build/TwoUp.icns, andbuild/TwoUp.iconsetinstead ofrm -rf build.Info.plistwithplutil -lintbefore packaging and auto-includeCore.swiftif present.$HOME/Applications(mkdir -p) before installing so fresh Macs don't fail.Info.plist: addNSAppTransportSecurity(NSAllowsArbitraryLoadsInWebContent = true) for plainhttp://web content, plusCFBundleInfoDictionaryVersion(6.0),LSApplicationCategoryType(public.app-category.news), andNSHumanReadableCopyright.docs/screenshot.png: palette-quantized viapngquantat 1800×1125 from 1,087,726 bytes to 354,269 bytes (−67.4%)..gitignore: ensurebuild/,.DS_Store,.impeccable/, and.claude/are ignored..github/workflows/ci.yml): runsbash -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 verifiesTwoUp.icnsis bundled.Verification
bash -n build.sh && shellcheck -S error build.sh— passed (0 errors, 0 warnings)plutil -lint Info.plist—Info.plist: OKswiftc -typecheck -swift-version 5 -warn-concurrency make_icon.swift— passed (0 warnings)./build.sh --build-only— builtbuild/TwoUp.app, preserved unrelated files inbuild/codesign --verify --deep --strict build/TwoUp.app— passedbuild/TwoUp.app/Contents/Resources/TwoUp.icns— 88 KB, unpacked viaiconutilconfirming all 10 iconset sizesswift make_icon.swift(no args) — exits 1 with usage message