diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-20 16:33:08 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-20 16:33:08 +0800 |
| commit | 0b4306938f75430ed1f44c5eb3bf4585cdfa9a9b (patch) | |
| tree | 8c7c5f5fbabafb18b3f787847b659e54a799f14f /scripts/m6c-package.sh | |
| parent | 3aa0049bb092694b5168d99bc6ac893b1db4740a (diff) | |
| download | living-village-0b4306938f75430ed1f44c5eb3bf4585cdfa9a9b.tar.gz | |
feat(m6c): add Linux release package and delivery docs
[Change Nature]
- This commit adds the M6c Linux delivery surface without changing simulation behavior.
[New Capability]
- Publish self-contained linux-x64 output with framework-dependent fallback and a package-relative launcher.
- Document the menu, controls, save paths, autoplay verification, milestones, and asset/license boundaries.
[Implementation]
- Add the M6c packaging and startup scripts.
- Add release notes and an asset/license inventory.
- Keep release artifacts and verification evidence under ignored artifacts/m6c-release/.
[Impact]
- Runtime code and M3 acceptance artifacts are unchanged.
- The package was exercised under Xvfb; prior provider metadata remains an unstaged worktree change.
Diffstat (limited to 'scripts/m6c-package.sh')
| -rwxr-xr-x | scripts/m6c-package.sh | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/scripts/m6c-package.sh b/scripts/m6c-package.sh new file mode 100755 index 0000000..d887ea6 --- /dev/null +++ b/scripts/m6c-package.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)" +PROJECT="$REPO_ROOT/src/LivingVillage.Desktop/LivingVillage.Desktop.fsproj" +STAMP="${M6C_TIMESTAMP:-$(date -u +%Y%m%dT%H%M%SZ)}" +PACKAGE_ROOT="$REPO_ROOT/artifacts/m6c-release/$STAMP" +APP_DIR="$PACKAGE_ROOT/app" +PUBLISH_LOG="$PACKAGE_ROOT/publish.log" + +if [[ -e "$PACKAGE_ROOT" ]]; then + printf 'Refusing to overwrite existing package directory: %s\n' "$PACKAGE_ROOT" >&2 + exit 2 +fi + +if ! command -v dotnet >/dev/null 2>&1; then + printf 'dotnet SDK is required to build the Linux package.\n' >&2 + exit 127 +fi + +mkdir -p "$APP_DIR" + +publish_args=( + "$PROJECT" + --configuration Release + --runtime linux-x64 + --output "$APP_DIR" + --nologo + -p:DebugType=None + -p:DebugSymbols=false +) + +runtime_mode="self-contained" +self_contained_exit=0 +if dotnet publish "${publish_args[@]}" --self-contained true >"$PUBLISH_LOG" 2>&1; then + : +else + self_contained_exit=$? + runtime_mode="framework-dependent" + rm -rf "$APP_DIR" + mkdir -p "$APP_DIR" + if ! dotnet publish "${publish_args[@]}" --self-contained false >>"$PUBLISH_LOG" 2>&1; then + printf 'Both self-contained and framework-dependent publish failed. See %s\n' "$PUBLISH_LOG" >&2 + exit 1 + fi +fi + +cp "$SCRIPT_DIR/m6c-run.sh" "$PACKAGE_ROOT/run-living-village.sh" +chmod +x "$PACKAGE_ROOT/run-living-village.sh" +cp "$REPO_ROOT/README.md" "$PACKAGE_ROOT/README.md" +cp "$REPO_ROOT/docs/release-notes-m6c.md" "$PACKAGE_ROOT/RELEASE-NOTES-M6C.md" +cp "$REPO_ROOT/docs/assets-and-licenses.md" "$PACKAGE_ROOT/ASSETS-AND-LICENSES.md" + +source_commit="unknown" +if git -C "$REPO_ROOT" rev-parse HEAD >/dev/null 2>&1; then + source_commit="$(git -C "$REPO_ROOT" rev-parse HEAD)" +fi + +{ + printf 'package=M6c Linux x64\n' + printf 'created_utc=%s\n' "$STAMP" + printf 'source_commit=%s\n' "$source_commit" + printf 'runtime_mode=%s\n' "$runtime_mode" + printf 'rid=linux-x64\n' + printf 'entrypoint=run-living-village.sh\n' + printf 'native_desktopgl_dependencies=system-provided\n' + if [[ "$runtime_mode" == "framework-dependent" ]]; then + printf 'self_contained_publish_exit=%s\n' "$self_contained_exit" + printf 'framework_dependent_requirement=.NET 8 runtime\n' + fi +} > "$PACKAGE_ROOT/PACKAGE-INFO.txt" + +printf 'M6C_PACKAGE_DIR=%s\n' "$PACKAGE_ROOT" +printf 'M6C_RUNTIME_MODE=%s\n' "$runtime_mode" |
