Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eac1fa595b | ||
|
|
e0191abb1e | ||
|
|
ec91c434b6 | ||
|
|
0497fd6066 | ||
|
|
0fe4661273 | ||
|
|
7d65b6aa0e | ||
|
|
8955a159db | ||
|
|
35acaca858 | ||
|
|
7a9195dab5 |
@@ -15,22 +15,39 @@ jobs:
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.SHRINKSDK_PACKAGE_TOKEN }}
|
||||
steps:
|
||||
- name: Fetch tagged revision
|
||||
- name: Fetch exact tagged release archive
|
||||
env:
|
||||
GITEA_REF: ${{ gitea.ref }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
ref="${{ gitea.sha }}"
|
||||
test -n "$ref"
|
||||
git init .
|
||||
git remote add origin "https://git.crash.work/ShrinkSDK/ShrinkApp.Core.git"
|
||||
git fetch --depth=1 origin "$ref"
|
||||
git checkout --detach FETCH_HEAD
|
||||
tag="${GITEA_REF#refs/tags/}"
|
||||
case "$tag" in
|
||||
v[0-9]*) ;;
|
||||
*) echo "Expected a version tag ref, got: $GITEA_REF" >&2; exit 1 ;;
|
||||
esac
|
||||
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
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
tag="$(git describe --exact-match --tags HEAD)"
|
||||
cd release
|
||||
tag="$(cat .shrink-sdk-release-tag)"
|
||||
version="$(node -p "require('./package.json').version")"
|
||||
test "$tag" = "v$version"
|
||||
npm pack --dry-run
|
||||
@@ -40,10 +57,11 @@ jobs:
|
||||
run: |
|
||||
set -eu
|
||||
: "${NODE_AUTH_TOKEN:?SHRINKSDK_PACKAGE_TOKEN is required}"
|
||||
cd release
|
||||
npmrc="$HOME/.npmrc"
|
||||
cleanup() { rm -f "$npmrc"; }
|
||||
trap cleanup EXIT
|
||||
printf '%s\n' \
|
||||
'registry=https://git.crash.work/api/packages/ShrinkSDK/npm/' \
|
||||
'//git.crash.work/api/packages/ShrinkSDK/npm/:_authToken=${NODE_AUTH_TOKEN}' > "$npmrc"
|
||||
npm publish --registry=https://git.crash.work/api/packages/ShrinkSDK/npm/
|
||||
npm publish --registry=https://git.crash.work/api/packages/ShrinkSDK/npm/
|
||||
|
||||
@@ -26,12 +26,17 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
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)"
|
||||
test -n "$unity_bin"
|
||||
"$unity_bin" \
|
||||
-batchmode \
|
||||
-nographics \
|
||||
-quit \
|
||||
-projectPath "$PWD/Development~/UnityProject" \
|
||||
-runTests \
|
||||
-testPlatform EditMode \
|
||||
|
||||
@@ -2,6 +2,19 @@
|
||||
|
||||
本文件记录 `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
|
||||
|
||||
### Added
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"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"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -6,14 +6,13 @@ namespace ShrinkApp.Editor
|
||||
{
|
||||
public static class ShrinkAppEditorMenu
|
||||
{
|
||||
[MenuItem("ShrinkApp/创建 Settings")]
|
||||
[MenuItem("ShrinkSDK/应用/创建设置")]
|
||||
public static void CreateSettingsAsset()
|
||||
{
|
||||
const string resourcesDir = "Assets/Resources";
|
||||
if (!AssetDatabase.IsValidFolder(resourcesDir))
|
||||
AssetDatabase.CreateFolder("Assets", "Resources");
|
||||
const string settingsDirectory = "Assets/Resources/GameAssets/Runtime/Data/ShrinkSDK";
|
||||
EnsureFolder(settingsDirectory);
|
||||
|
||||
const string assetPath = "Assets/Resources/ShrinkAppSettings.asset";
|
||||
const string assetPath = settingsDirectory + "/ShrinkAppSettings.asset";
|
||||
var existing = AssetDatabase.LoadAssetAtPath<ShrinkAppSettings>(assetPath);
|
||||
if (existing != null)
|
||||
{
|
||||
@@ -34,6 +33,19 @@ namespace ShrinkApp.Editor
|
||||
EditorGUIUtility.PingObject(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
|
||||
|
||||
@@ -21,6 +21,11 @@ IShrinkAppModuleInstaller
|
||||
[ShrinkAppModuleInstaller]
|
||||
```
|
||||
|
||||
`ShrinkAppSettings` 运行时优先从
|
||||
`Resources/GameAssets/Runtime/Data/ShrinkSDK/ShrinkAppSettings.asset` 加载;旧项目的
|
||||
`Resources/ShrinkAppSettings.asset` 继续作为回退。菜单 `ShrinkSDK/应用/创建设置`
|
||||
会直接创建到新的标准目录。
|
||||
|
||||
## 启动流程
|
||||
|
||||
1. `ShrinkApp` 在 `RuntimeInitializeOnLoadMethod(BeforeSceneLoad)` 创建宿主。
|
||||
|
||||
@@ -117,9 +117,13 @@ namespace ShrinkApp
|
||||
ContextLoader = 1,
|
||||
}
|
||||
|
||||
[CreateAssetMenu(fileName = "ShrinkAppSettings", menuName = "ShrinkApp/Settings")]
|
||||
[CreateAssetMenu(fileName = "ShrinkAppSettings", menuName = "ShrinkSDK/应用/应用设置")]
|
||||
public class ShrinkAppSettings : ScriptableObject
|
||||
{
|
||||
public const string PreferredResourcesPath =
|
||||
"GameAssets/Runtime/Data/ShrinkSDK/ShrinkAppSettings";
|
||||
public const string LegacyResourcesPath = "ShrinkAppSettings";
|
||||
|
||||
private static ShrinkAppSettings? _instance;
|
||||
|
||||
public static ShrinkAppSettings Instance
|
||||
@@ -129,7 +133,9 @@ namespace ShrinkApp
|
||||
if (_instance != null)
|
||||
return _instance;
|
||||
|
||||
_instance = Resources.Load<ShrinkAppSettings>("ShrinkAppSettings");
|
||||
_instance = Resources.Load<ShrinkAppSettings>(PreferredResourcesPath);
|
||||
if (!_instance)
|
||||
_instance = Resources.Load<ShrinkAppSettings>(LegacyResourcesPath);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (!_instance)
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "com.cneicy.shrink-app-core",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.4",
|
||||
"displayName": "ShrinkApp Core",
|
||||
"description": "Shrink 系列统一宿主层,提供模块安装器、服务容器与统一启动流程。",
|
||||
"unity": "2022.3",
|
||||
"dependencies": {
|
||||
"com.cneicy.shrink-eventbus": "2.0.0",
|
||||
"com.cneicy.shrink-eventbus": "2.0.1",
|
||||
"com.cneicy.shrink-shared-codegen": "0.1.0",
|
||||
"com.cysharp.unitask": "2.5.10"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user