Skip to content

Commit 0ce79c9

Browse files
committed
fix(release): embed MPL distribution notices
1 parent e070069 commit 0ce79c9

14 files changed

Lines changed: 188 additions & 10 deletions

docs/development/macos-playtest-package.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Build and package it with Unity `6000.5.6f1`:
1414
The script builds the native plug-in, synchronizes Core, invokes the checked-in
1515
Unity build method, embeds the arm64 plug-in, applies an ad-hoc signature,
1616
verifies the bundle, and creates a resource-fork-safe ZIP under
17-
`artifacts/game/`.
17+
`artifacts/game/`. The application and ZIP include `Legal/` with the MPL text,
18+
project and third-party notices, and `SOURCE-CODE.txt`, which identifies the
19+
exact public Git revision corresponding to the build.
1820

1921
This playtest packaging is intentionally not a production distribution flow.
2022
Unity gives the local build an ad-hoc signature, but downloading it on another

docs/development/macos-signing-notarization.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ is the simpler and safer release procedure.
7272
`build-macos-distribution-app.sh` builds the native arm64 CoreMIDI plug-in,
7373
synchronizes the managed Core assembly, and asks Unity to create a non-
7474
Development macOS player. The bundle identifier remains
75-
`com.codewriter90x.hitthekit`.
75+
`com.codewriter90x.hitthekit`. Before signing, it installs the MPL license,
76+
project notice, third-party notices, licensing overview, and an exact-revision
77+
`SOURCE-CODE.txt` under `Contents/Resources/Legal`. The final DMG exposes the
78+
same `Legal/` directory at its top level.
7679

7780
`sign-macos-app.sh` signs a staged copy and replaces the input only after the
7881
staged bundle passes strict verification. It signs every nested Mach-O first,

docs/development/windows-playtest-package.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ Build and package with:
2020

2121
The script synchronizes the tested Core assembly, asks Unity for a clean
2222
`StandaloneWindows64` player, rejects a package containing the CoreMIDI native
23-
plug-in, adds player instructions, creates a ZIP, and prints its SHA-256.
23+
plug-in, adds player instructions and a `Legal/` directory, creates a ZIP, and
24+
prints its SHA-256. `Legal/SOURCE-CODE.txt` identifies the exact public Git
25+
revision for the MPL-covered HitTheKit files in that executable distribution.
2426
Generated output remains under the ignored `artifacts/game` directory.
2527

2628
The Windows player contains `HitTheKit.exe`, `HitTheKit_Data`, Unity runtime
@@ -41,6 +43,13 @@ test the exact ZIP on clean Windows 10 and Windows 11 machines:
4143
6. confirm Device Setup states clearly that production MIDI is macOS-only; and
4244
7. collect logs and screenshots without personal paths or third-party content.
4345

46+
## MIDI support
47+
48+
Installing Unity Windows Build Support enables player compilation only. It
49+
does not provide production MIDI input. Windows electronic-drum support needs
50+
a separately implemented and tested Windows MIDI backend; until then the
51+
Windows player is keyboard-only.
52+
4453
## Signing and public distribution
4554

4655
The current script intentionally creates an **unsigned playtest**. It is not a

docs/legal/ASSET_PROVENANCE.sha256

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ aeb85dcd4d2146f541a20b059d0202b4b74e26d36bb0c4d6a69e3216b53d32b3 branding/app-i
3636
33d46381305d6bfc6fd2e46756f60161d72c3dce538ad91159cb535867d8621a branding/app-icon/web/favicon-48.png
3737
dd14c102c960582dce3a4a2f666acbd5fb6534aba34f065ce48ba176734e300f branding/app-icon/web/pwa-icon-192.png
3838
09f9ef07c0a1e723f81ee00a8116eb2750d8d3138e679ca73f49e4d7e8652c73 branding/app-icon/web/pwa-icon-512.png
39+
dc7b225e09748d09fcf02c46b71f575d3d42547b4e49143da01a7710703f0ee3 branding/app-icon/windows/HitTheKit.ico
3940
8b02be0ccd2c4565006246b3f8ce576367bed735bc122716c28d5120c53afd70 docs/design/evidence/gameplay-environments-v2-comparison.jpg
4041
1503f47d91d43f2e7ea3484036329c839c338d757d6a7051e54ce97c9bd70512 docs/design/references/main-menu-stage-command-concept.png
4142
0a150d383929d087670d0aefe28964e3786875964f88901fe8053a96e8895321 docs/design/references/modern-drum-kit-hd-concept.png

docs/release/RELEASE_PROCESS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ are created only from reviewed commits on `main`.
1717
3. Stop feature work on the candidate; only reviewed release blockers may
1818
change it.
1919
4. Record the commit SHA in the release evidence.
20+
5. Keep the worktree clean so `SOURCE-CODE.txt` can identify the exact public
21+
revision corresponding to every executable candidate.
2022

2123
## 2. Run source and packaging contracts
2224

@@ -95,6 +97,9 @@ Signing credentials remain outside Git. On the authorized release Mac:
9597

9698
The pipeline must finish with `HITTHEKIT_MACOS_DISTRIBUTION_READY`. Verify the
9799
stapled application and each archive again after copying to the clean test Mac.
100+
Confirm that the application resources and DMG both include `Legal/` with
101+
`LICENSE`, `NOTICE`, `THIRD_PARTY_NOTICES.md`,
102+
`LICENSING.md`, and an exact-revision `SOURCE-CODE.txt`.
98103

99104
## 7. Prepare evidence
100105

scripts/build-macos-distribution-app.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ fail() {
2121
[ ! -e "$APP_PATH" ] || fail "output already exists: $APP_PATH"
2222
[ -x "$UNITY_PATH" ] || fail "Unity 6000.5.6f1 was not found at: $UNITY_PATH"
2323

24+
SOURCE_COMMIT=${HITTHEKIT_SOURCE_COMMIT:-}
25+
if [ -z "$SOURCE_COMMIT" ]; then
26+
[ -z "$(git -C "$REPOSITORY_ROOT" status --porcelain)" ] ||
27+
fail "the release candidate must be committed and clean before building"
28+
SOURCE_COMMIT=$(git -C "$REPOSITORY_ROOT" rev-parse HEAD)
29+
fi
30+
2431
OUTPUT_ROOT=$(dirname -- "$APP_PATH")
2532
mkdir -p "$OUTPUT_ROOT"
2633
APP_PATH=$(cd "$OUTPUT_ROOT" && pwd)/$(basename -- "$APP_PATH")
@@ -58,6 +65,9 @@ PLIST="$APP_PATH/Contents/Info.plist"
5865
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $VERSION" "$PLIST"
5966
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILD_NUMBER" "$PLIST"
6067
"$REPOSITORY_ROOT/scripts/apply-macos-app-icon.sh" "$APP_PATH"
68+
HITTHEKIT_SOURCE_COMMIT="$SOURCE_COMMIT" \
69+
"$REPOSITORY_ROOT/scripts/install-distribution-notices.sh" \
70+
"$APP_PATH/Contents/Resources/Legal" "$VERSION"
6171
EXECUTABLE=$(/usr/libexec/PlistBuddy -c "Print :CFBundleExecutable" "$PLIST")
6272
MAIN_BINARY="$APP_PATH/Contents/MacOS/$EXECUTABLE"
6373

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
SCRIPT_DIR=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)
5+
REPOSITORY_ROOT=$(CDPATH='' cd -- "$SCRIPT_DIR/.." && pwd)
6+
DESTINATION=${1:-}
7+
VERSION=${2:-}
8+
SOURCE_REPOSITORY=https://github.com/Codewriter90x/HitTheKit
9+
10+
fail() {
11+
echo "distribution notices: $*" >&2
12+
exit 1
13+
}
14+
15+
[ -n "$DESTINATION" ] && [ -n "$VERSION" ] ||
16+
fail "usage: $0 <destination-directory> <version>"
17+
[[ "$VERSION" =~ ^[0-9]+([.][0-9]+){1,2}([-.][0-9A-Za-z.-]+)?$ ]] ||
18+
fail "version must identify a release, for example 0.5.0 or 0.5.0-rc.1"
19+
20+
SOURCE_COMMIT=${HITTHEKIT_SOURCE_COMMIT:-}
21+
if [ -z "$SOURCE_COMMIT" ]; then
22+
[ -z "$(git -C "$REPOSITORY_ROOT" status --porcelain)" ] ||
23+
fail "the repository is dirty; commit the exact candidate or set HITTHEKIT_SOURCE_COMMIT explicitly"
24+
SOURCE_COMMIT=$(git -C "$REPOSITORY_ROOT" rev-parse HEAD)
25+
fi
26+
27+
[[ "$SOURCE_COMMIT" =~ ^[0-9a-f]{40}$ ]] ||
28+
fail "HITTHEKIT_SOURCE_COMMIT must be a full 40-character lowercase Git SHA"
29+
git -C "$REPOSITORY_ROOT" cat-file -e "$SOURCE_COMMIT^{commit}" 2>/dev/null ||
30+
fail "source commit is not present in this repository: $SOURCE_COMMIT"
31+
32+
for required_file in LICENSE NOTICE THIRD_PARTY_NOTICES.md LICENSING.md; do
33+
[ -f "$REPOSITORY_ROOT/$required_file" ] ||
34+
fail "required legal file is missing: $required_file"
35+
done
36+
37+
mkdir -p "$DESTINATION"
38+
install -m 0644 "$REPOSITORY_ROOT/LICENSE" "$DESTINATION/LICENSE"
39+
install -m 0644 "$REPOSITORY_ROOT/NOTICE" "$DESTINATION/NOTICE"
40+
install -m 0644 "$REPOSITORY_ROOT/THIRD_PARTY_NOTICES.md" \
41+
"$DESTINATION/THIRD_PARTY_NOTICES.md"
42+
install -m 0644 "$REPOSITORY_ROOT/LICENSING.md" \
43+
"$DESTINATION/LICENSING.md"
44+
45+
printf '%s\n' \
46+
'HitTheKit corresponding source code notice' \
47+
'' \
48+
"Binary version: $VERSION" \
49+
"Exact source revision: $SOURCE_COMMIT" \
50+
'' \
51+
'The Source Code Form of MPL-2.0-covered HitTheKit files in this' \
52+
'distribution is available from the exact public revision below:' \
53+
'' \
54+
"$SOURCE_REPOSITORY/tree/$SOURCE_COMMIT" \
55+
'' \
56+
'A downloadable archive of that revision is available at:' \
57+
'' \
58+
"$SOURCE_REPOSITORY/archive/$SOURCE_COMMIT.zip" \
59+
'' \
60+
'The MPL-2.0 license text, project notice, licensing overview, and' \
61+
'third-party notices are included in this Legal directory.' \
62+
'' \
63+
'Unity and third-party components retain their own licenses and are not' \
64+
'relicensed by HitTheKit.' \
65+
> "$DESTINATION/SOURCE-CODE.txt"
66+
67+
echo "HITTHEKIT_DISTRIBUTION_NOTICES_INSTALLED"
68+
echo "destination=$DESTINATION"
69+
echo "sourceCommit=$SOURCE_COMMIT"

scripts/package-game-macos-arm64.sh

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/bin/sh
2-
set -eu
1+
#!/bin/bash
2+
set -euo pipefail
33

4-
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
5-
REPOSITORY_ROOT=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
4+
SCRIPT_DIR=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)
5+
REPOSITORY_ROOT=$(CDPATH='' cd -- "$SCRIPT_DIR/.." && pwd)
66
UNITY_PATH=${UNITY_PATH:-/Applications/Unity/Hub/Editor/6000.5.6f1/Unity.app/Contents/MacOS/Unity}
77
BUILD_VERSION=${1:-0.1.0}
88
OUTPUT_ROOT=${2:-"$REPOSITORY_ROOT/artifacts/game/macos-arm64-$BUILD_VERSION"}
@@ -21,6 +21,15 @@ if [ -e "$OUTPUT_ROOT" ]; then
2121
exit 3
2222
fi
2323

24+
SOURCE_COMMIT=${HITTHEKIT_SOURCE_COMMIT:-}
25+
if [ -z "$SOURCE_COMMIT" ]; then
26+
[ -z "$(git -C "$REPOSITORY_ROOT" status --porcelain)" ] || {
27+
echo "The playtest source must be committed and clean before packaging." >&2
28+
exit 4
29+
}
30+
SOURCE_COMMIT=$(git -C "$REPOSITORY_ROOT" rev-parse HEAD)
31+
fi
32+
2433
mkdir -p "$OUTPUT_ROOT"
2534

2635
"$REPOSITORY_ROOT/scripts/build-coremidi-plugin-macos-arm64.sh"
@@ -51,11 +60,19 @@ cp "$SOURCE_COREMIDI_PLUGIN" "$COREMIDI_PLUGIN"
5160
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $BUILD_VERSION" "$APP_PATH/Contents/Info.plist"
5261
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILD_VERSION" "$APP_PATH/Contents/Info.plist"
5362
"$REPOSITORY_ROOT/scripts/apply-macos-app-icon.sh" "$APP_PATH"
63+
HITTHEKIT_SOURCE_COMMIT="$SOURCE_COMMIT" \
64+
"$REPOSITORY_ROOT/scripts/install-distribution-notices.sh" \
65+
"$APP_PATH/Contents/Resources/Legal" "$BUILD_VERSION"
5466
BINARY_NAME=$(/usr/libexec/PlistBuddy -c "Print :CFBundleExecutable" "$APP_PATH/Contents/Info.plist")
5567
MAIN_BINARY="$APP_PATH/Contents/MacOS/$BINARY_NAME"
5668

57-
codesign --force --sign - "$COREMIDI_PLUGIN"
58-
codesign --force --deep --sign - "$APP_PATH"
69+
while IFS= read -r -d '' candidate; do
70+
[ "$candidate" != "$MAIN_BINARY" ] || continue
71+
if file -b "$candidate" | grep -q 'Mach-O'; then
72+
codesign --force --sign - "$candidate"
73+
fi
74+
done < <(find "$APP_PATH/Contents" -type f -print0)
75+
codesign --force --sign - "$APP_PATH"
5976

6077
test -x "$MAIN_BINARY"
6178
test -f "$COREMIDI_PLUGIN"
@@ -65,6 +82,7 @@ codesign --verify --deep --strict --verbose=2 "$APP_PATH"
6582

6683
mkdir -p "$PACKAGE_ROOT"
6784
cp -R "$APP_PATH" "$PACKAGE_ROOT/HitTheKit.app"
85+
ditto "$APP_PATH/Contents/Resources/Legal" "$PACKAGE_ROOT/Legal"
6886
printf '%s\n' \
6987
'HitTheKit macOS Apple Silicon playtest' \
7088
'' \
@@ -74,6 +92,7 @@ printf '%s\n' \
7492
'' \
7593
'This early playtest is ad-hoc signed and not yet Apple-notarized.' \
7694
'No Unity installation is required.' \
95+
'License, notices, and exact source information are in Legal/.' \
7796
> "$PACKAGE_ROOT/README-FIRST.txt"
7897

7998
ditto -c -k --sequesterRsrc --keepParent "$PACKAGE_ROOT" "$ZIP_PATH"

scripts/package-game-windows-x64.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,16 @@ OUTPUT_ROOT=${OUTPUT_ROOT:-"$REPOSITORY_ROOT/artifacts/game/windows-x64-$VERSION
2020
[ ! -e "$OUTPUT_ROOT" ] || fail "output directory already exists: $OUTPUT_ROOT"
2121
[ -x "$UNITY_PATH" ] || fail "Unity 6000.5.6f1 was not found at: $UNITY_PATH"
2222

23+
SOURCE_COMMIT=${HITTHEKIT_SOURCE_COMMIT:-}
24+
if [ -z "$SOURCE_COMMIT" ]; then
25+
[ -z "$(git -C "$REPOSITORY_ROOT" status --porcelain)" ] ||
26+
fail "the playtest source must be committed and clean before packaging"
27+
SOURCE_COMMIT=$(git -C "$REPOSITORY_ROOT" rev-parse HEAD)
28+
fi
29+
2330
UNITY_APP=$(CDPATH='' cd -- "$(dirname -- "$UNITY_PATH")/../.." && pwd)
24-
WINDOWS_SUPPORT="$UNITY_APP/Contents/PlaybackEngines/WindowsStandaloneSupport"
31+
UNITY_INSTALL_ROOT=$(CDPATH='' cd -- "$UNITY_APP/.." && pwd)
32+
WINDOWS_SUPPORT="$UNITY_INSTALL_ROOT/PlaybackEngines/WindowsStandaloneSupport"
2533
[ -d "$WINDOWS_SUPPORT" ] || \
2634
fail "Unity Windows Build Support (Mono) is not installed for 6000.5.6f1"
2735

@@ -56,6 +64,10 @@ UNEXPECTED_PLUGIN=$(find "$PLAYER_ROOT" -iname '*HitTheKitCoreMidi*' -print -qui
5664
[ -z "$UNEXPECTED_PLUGIN" ] || \
5765
fail "macOS CoreMIDI plug-in leaked into the Windows package: $UNEXPECTED_PLUGIN"
5866

67+
HITTHEKIT_SOURCE_COMMIT="$SOURCE_COMMIT" \
68+
"$REPOSITORY_ROOT/scripts/install-distribution-notices.sh" \
69+
"$PLAYER_ROOT/Legal" "$VERSION"
70+
5971
printf '%s\n' \
6072
'HitTheKit Windows x64 playtest' \
6173
'' \
@@ -66,6 +78,7 @@ printf '%s\n' \
6678
'Electronic-drum MIDI is not implemented on Windows yet.' \
6779
'This playtest package is unsigned and is not approved for public release.' \
6880
'Verify the published SHA-256 before running any future release package.' \
81+
'License, notices, and exact source information are in Legal/.' \
6982
> "$PLAYER_ROOT/README-FIRST.txt"
7083

7184
ditto --norsrc --noextattr -c -k --keepParent "$PLAYER_ROOT" "$ZIP_PATH"

scripts/package-macos-dmg.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ resolve_identity() {
3131
fail "usage: $0 <notarized-HitTheKit.app> <output.dmg>"
3232
[[ "$APP_PATH" == *.app ]] || fail "input must be an .app bundle"
3333
[ -d "$APP_PATH/Contents" ] || fail "app bundle does not exist or is invalid: $APP_PATH"
34+
LEGAL_SOURCE="$APP_PATH/Contents/Resources/Legal"
35+
[ -f "$LEGAL_SOURCE/SOURCE-CODE.txt" ] ||
36+
fail "app bundle lacks the MPL source disclosure: $LEGAL_SOURCE/SOURCE-CODE.txt"
3437
[[ "$OUTPUT_DMG" == *.dmg ]] || fail "output must use the .dmg extension"
3538
[ ! -e "$OUTPUT_DMG" ] || fail "output already exists: $OUTPUT_DMG"
3639

@@ -59,6 +62,7 @@ trap cleanup EXIT INT TERM
5962

6063
mkdir -p "$STAGE_ROOT"
6164
ditto "$APP_PATH" "$STAGE_ROOT/HitTheKit.app"
65+
ditto "$LEGAL_SOURCE" "$STAGE_ROOT/Legal"
6266
ln -s /Applications "$STAGE_ROOT/Applications"
6367
hdiutil create -quiet -volname "HitTheKit" -srcfolder "$STAGE_ROOT" -format UDZO "$TEMP_DMG"
6468
hdiutil verify "$TEMP_DMG" >/dev/null

0 commit comments

Comments
 (0)