Show the build's git commit next to the version in Settings - #8
Merged
Conversation
Stamp BuildMetadata.xcconfig with the short HEAD hash via a scheme build pre-action (and explicitly in CI), feed it through BuildConfig.xcconfig into Info.plist as GITCommitHash, and render "Version 1.3.0 (a1b2c3d)" in Settings. Builds made outside a git checkout fall back to "dev". Update checks still compare the marketing version only.
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.
Mirrors how KeeForge surfaces the build commit.
What changed
scripts/stamp_build_metadata.shwrites the shortHEADhash to an untrackedBuildMetadata.xcconfig.BuildConfig.xcconfig(new, committed) is the config entry point for Debug and Release; it#include?s the localConfig.xcconfigand the generatedBuildMetadata.xcconfig.TaskMenuscheme is now explicit inproject.ymlwith a build pre-action that runs the stamp script, so plain Xcode/xcodebuildbuilds get the hash. CI and the release workflow also run the script explicitly before building/archiving.Info.plistgainsGITCommitHash=$(GIT_COMMIT_HASH).AppStateexposescurrentBuildCommitandcurrentAppVersionDisplay; Settings rendersVersion 1.3.0 (a1b2c3d). Unstamped builds showVersion 1.3.0 (dev). Update checks still comparecurrentAppVersion(marketing version) only.Verification
xcodebuild buildfrom a state with noBuildMetadata.xcconfig: the pre-action stamped it and the same build picked it up — builtContents/Info.plisthasGITCommitHash = ff60523, matchinggit rev-parse --short HEAD.AppStateTestsversion-display cases andSettingsVersionRowTests, which renders the real Settings window and asserts the version row text.