9 Commits
Author SHA1 Message Date
cneicy eac1fa595b chore: release 0.1.4
Publish UPM package / publish (push) Successful in 2s
2026-08-28 04:31:00 +08:00
cneicy e0191abb1e feat(settings): 优先加载标准 ShrinkSDK 资源路径
Publish UPM package / publish (push) Successful in 2s
2026-08-28 03:44:10 +08:00
cneicy ec91c434b6 chore(editor): unify application menus
Publish UPM package / publish (push) Successful in 2s
2026-08-26 12:48:30 +08:00
cneicy 0497fd6066 test(host): allow Unity test runner completion 2026-08-26 08:22:28 +08:00
cneicy 0fe4661273 ci: mirror Git package dependencies 2026-08-26 07:06:58 +08:00
cneicy 7d65b6aa0e test: enable standalone host discovery 2026-08-26 06:56:00 +08:00
cneicy 8955a159db ci: stabilize standalone Unity host 2026-08-26 06:36:30 +08:00
ShrinkSDK Automation 35acaca858 ci: fetch immutable release archive 2026-08-26 04:29:33 +08:00
ShrinkSDK Automation 7a9195dab5 ci: install Git in package publisher 2026-08-26 03:09:40 +08:00
8 changed files with 84 additions and 21 deletions
+26 -8
View File
@@ -15,22 +15,39 @@ jobs:
env: env:
NODE_AUTH_TOKEN: ${{ secrets.SHRINKSDK_PACKAGE_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.SHRINKSDK_PACKAGE_TOKEN }}
steps: steps:
- name: Fetch tagged revision - name: Fetch exact tagged release archive
env:
GITEA_REF: ${{ gitea.ref }}
shell: bash shell: bash
run: | run: |
set -eu set -eu
ref="${{ gitea.sha }}" tag="${GITEA_REF#refs/tags/}"
test -n "$ref" case "$tag" in
git init . v[0-9]*) ;;
git remote add origin "https://git.crash.work/ShrinkSDK/ShrinkApp.Core.git" *) echo "Expected a version tag ref, got: $GITEA_REF" >&2; exit 1 ;;
git fetch --depth=1 origin "$ref" esac
git checkout --detach FETCH_HEAD export SHRINKSDK_ARCHIVE_URL="https://git.crash.work/ShrinkSDK/ShrinkApp.Core/archive/${tag}.tar.gz"
node --input-type=module <<'NODE'
import { writeFile } from 'node:fs/promises';
const response = await fetch(process.env.SHRINKSDK_ARCHIVE_URL);
if (!response.ok) {
throw new Error(`Release archive download failed: ${response.status} ${response.statusText}`);
}
await writeFile('release.tar.gz', new Uint8Array(await response.arrayBuffer()));
NODE
mkdir release
tar -xzf release.tar.gz --strip-components=1 -C release
rm -f release.tar.gz
printf '%s' "$tag" > release/.shrink-sdk-release-tag
- name: Validate immutable release version - name: Validate immutable release version
shell: bash shell: bash
run: | run: |
set -eu set -eu
tag="$(git describe --exact-match --tags HEAD)" cd release
tag="$(cat .shrink-sdk-release-tag)"
version="$(node -p "require('./package.json').version")" version="$(node -p "require('./package.json').version")"
test "$tag" = "v$version" test "$tag" = "v$version"
npm pack --dry-run npm pack --dry-run
@@ -40,6 +57,7 @@ jobs:
run: | run: |
set -eu set -eu
: "${NODE_AUTH_TOKEN:?SHRINKSDK_PACKAGE_TOKEN is required}" : "${NODE_AUTH_TOKEN:?SHRINKSDK_PACKAGE_TOKEN is required}"
cd release
npmrc="$HOME/.npmrc" npmrc="$HOME/.npmrc"
cleanup() { rm -f "$npmrc"; } cleanup() { rm -f "$npmrc"; }
trap cleanup EXIT trap cleanup EXIT
+6 -1
View File
@@ -26,12 +26,17 @@ jobs:
shell: bash shell: bash
run: | run: |
set -eu set -eu
machine_id_file="/root/.local/share/unity3d/Unity/.machine-id"
if test -s "$machine_id_file"; then
cat "$machine_id_file" > /etc/machine-id
echo "Unity machine identity restored"
fi
git config --global url."https://ghfast.top/https://github.com/".insteadOf "https://github.com/"
unity_bin="$(command -v unity-editor || command -v unity || command -v Unity || true)" unity_bin="$(command -v unity-editor || command -v unity || command -v Unity || true)"
test -n "$unity_bin" test -n "$unity_bin"
"$unity_bin" \ "$unity_bin" \
-batchmode \ -batchmode \
-nographics \ -nographics \
-quit \
-projectPath "$PWD/Development~/UnityProject" \ -projectPath "$PWD/Development~/UnityProject" \
-runTests \ -runTests \
-testPlatform EditMode \ -testPlatform EditMode \
+13
View File
@@ -2,6 +2,19 @@
本文件记录 `ShrinkApp.Core` 的包内变更。 本文件记录 `ShrinkApp.Core` 的包内变更。
## [0.1.4] - 2026-08-28
### Changed
- 精确依赖 `ShrinkEventBus 2.0.1`
## [0.1.3] - 2026-08-28
### Changed
- `ShrinkAppSettings` 优先从 `GameAssets/Runtime/Data/ShrinkSDK/ShrinkAppSettings` 加载,并保留旧根路径回退。
- `ShrinkSDK/应用/创建设置` 统一在标准 `Resources/GameAssets/Runtime/Data/ShrinkSDK` 目录创建配置。
## [0.1.1] - 2026-08-16 ## [0.1.1] - 2026-08-16
### Added ### Added
@@ -10,6 +10,10 @@
], ],
"dependencies": { "dependencies": {
"com.unity.test-framework": "1.1.33", "com.unity.test-framework": "1.1.33",
"com.cneicy.shrink-app-core": "file:../../.." "com.cneicy.shrink-app-core": "file:../../..",
} "com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#7c0f199fe0d3fc528024488ccd671e6c7b27745b"
},
"testables": [
"com.cneicy.shrink-app-core"
]
} }
+17 -5
View File
@@ -6,14 +6,13 @@ namespace ShrinkApp.Editor
{ {
public static class ShrinkAppEditorMenu public static class ShrinkAppEditorMenu
{ {
[MenuItem("ShrinkApp/创建 Settings")] [MenuItem("ShrinkSDK/应用/创建设置")]
public static void CreateSettingsAsset() public static void CreateSettingsAsset()
{ {
const string resourcesDir = "Assets/Resources"; const string settingsDirectory = "Assets/Resources/GameAssets/Runtime/Data/ShrinkSDK";
if (!AssetDatabase.IsValidFolder(resourcesDir)) EnsureFolder(settingsDirectory);
AssetDatabase.CreateFolder("Assets", "Resources");
const string assetPath = "Assets/Resources/ShrinkAppSettings.asset"; const string assetPath = settingsDirectory + "/ShrinkAppSettings.asset";
var existing = AssetDatabase.LoadAssetAtPath<ShrinkAppSettings>(assetPath); var existing = AssetDatabase.LoadAssetAtPath<ShrinkAppSettings>(assetPath);
if (existing != null) if (existing != null)
{ {
@@ -34,6 +33,19 @@ namespace ShrinkApp.Editor
EditorGUIUtility.PingObject(asset); EditorGUIUtility.PingObject(asset);
Debug.Log("[ShrinkApp] 已创建 ShrinkAppSettings.asset"); Debug.Log("[ShrinkApp] 已创建 ShrinkAppSettings.asset");
} }
private static void EnsureFolder(string path)
{
var segments = path.Split('/');
var current = segments[0];
for (var i = 1; i < segments.Length; i++)
{
var next = current + "/" + segments[i];
if (!AssetDatabase.IsValidFolder(next))
AssetDatabase.CreateFolder(current, segments[i]);
current = next;
}
}
} }
} }
#endif #endif
+5
View File
@@ -21,6 +21,11 @@ IShrinkAppModuleInstaller
[ShrinkAppModuleInstaller] [ShrinkAppModuleInstaller]
``` ```
`ShrinkAppSettings` 运行时优先从
`Resources/GameAssets/Runtime/Data/ShrinkSDK/ShrinkAppSettings.asset` 加载;旧项目的
`Resources/ShrinkAppSettings.asset` 继续作为回退。菜单 `ShrinkSDK/应用/创建设置`
会直接创建到新的标准目录。
## 启动流程 ## 启动流程
1. `ShrinkApp``RuntimeInitializeOnLoadMethod(BeforeSceneLoad)` 创建宿主。 1. `ShrinkApp``RuntimeInitializeOnLoadMethod(BeforeSceneLoad)` 创建宿主。
+8 -2
View File
@@ -117,9 +117,13 @@ namespace ShrinkApp
ContextLoader = 1, ContextLoader = 1,
} }
[CreateAssetMenu(fileName = "ShrinkAppSettings", menuName = "ShrinkApp/Settings")] [CreateAssetMenu(fileName = "ShrinkAppSettings", menuName = "ShrinkSDK/应用/应用设置")]
public class ShrinkAppSettings : ScriptableObject public class ShrinkAppSettings : ScriptableObject
{ {
public const string PreferredResourcesPath =
"GameAssets/Runtime/Data/ShrinkSDK/ShrinkAppSettings";
public const string LegacyResourcesPath = "ShrinkAppSettings";
private static ShrinkAppSettings? _instance; private static ShrinkAppSettings? _instance;
public static ShrinkAppSettings Instance public static ShrinkAppSettings Instance
@@ -129,7 +133,9 @@ namespace ShrinkApp
if (_instance != null) if (_instance != null)
return _instance; return _instance;
_instance = Resources.Load<ShrinkAppSettings>("ShrinkAppSettings"); _instance = Resources.Load<ShrinkAppSettings>(PreferredResourcesPath);
if (!_instance)
_instance = Resources.Load<ShrinkAppSettings>(LegacyResourcesPath);
#if UNITY_EDITOR #if UNITY_EDITOR
if (!_instance) if (!_instance)
+2 -2
View File
@@ -1,11 +1,11 @@
{ {
"name": "com.cneicy.shrink-app-core", "name": "com.cneicy.shrink-app-core",
"version": "0.1.1", "version": "0.1.4",
"displayName": "ShrinkApp Core", "displayName": "ShrinkApp Core",
"description": "Shrink 系列统一宿主层,提供模块安装器、服务容器与统一启动流程。", "description": "Shrink 系列统一宿主层,提供模块安装器、服务容器与统一启动流程。",
"unity": "2022.3", "unity": "2022.3",
"dependencies": { "dependencies": {
"com.cneicy.shrink-eventbus": "2.0.0", "com.cneicy.shrink-eventbus": "2.0.1",
"com.cneicy.shrink-shared-codegen": "0.1.0", "com.cneicy.shrink-shared-codegen": "0.1.0",
"com.cysharp.unitask": "2.5.10" "com.cysharp.unitask": "2.5.10"
}, },