8 Commits
Author SHA1 Message Date
cneicy 2f9b0ff512 chore(editor): remove duplicate tutorial menus
Publish UPM package / publish (push) Successful in 2s
2026-08-26 12:48:32 +08:00
cneicy fbba140fd6 fix(tutorial): declare JsonUtility module
Publish UPM package / publish (push) Successful in 3s
2026-08-26 11:03:32 +08:00
cneicy b2ce5637a0 test(host): allow Unity test runner completion 2026-08-26 08:23:19 +08:00
cneicy b589f2a385 ci: mirror Git package dependencies 2026-08-26 07:07:06 +08:00
cneicy e279c4230e test: enable standalone host discovery 2026-08-26 06:56:08 +08:00
cneicy 61b7c4da73 ci: stabilize standalone Unity host 2026-08-26 06:36:38 +08:00
ShrinkSDK Automation 98c43fc193 ci: fetch immutable release archive 2026-08-26 04:29:42 +08:00
ShrinkSDK Automation 4b843ea337 ci: install Git in package publisher 2026-08-26 03:09:52 +08:00
10 changed files with 47 additions and 34 deletions
+27 -9
View File
@@ -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/ShrinkTutorial.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/ShrinkTutorial/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/
+6 -1
View File
@@ -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 \
+4
View File
@@ -1,5 +1,9 @@
# Changelog
## 0.1.1
- 声明 `JsonUtility` 所需的 Unity JSON Serialize 模块,使包可在最小消费者项目中独立解析与编译。
## Unreleased
- 修复 `ClickTarget` 对 UI 目标过早在按下阶段完成的问题,改为等待指针释放并确认 EventSystem 射线真实命中目标后再过步。
@@ -11,5 +11,8 @@
"dependencies": {
"com.unity.test-framework": "1.1.33",
"com.cneicy.shrink-tutorial": "file:../../.."
}
},
"testables": [
"com.cneicy.shrink-tutorial"
]
}
@@ -104,12 +104,6 @@ namespace ShrinkTutorial.Editor
Debug.Log("[ShrinkTutorial] Sample scene created: Assets/Scenes/ShrinkTutorialSample.unity");
}
[MenuItem("ShrinkSDK/Tutorial/Create Sample Scene")]
public static void BuildSampleSceneAlias()
{
BuildSampleScene();
}
private static ShrinkTutorialSettings EnsureSettings()
{
var settings = AssetDatabase.LoadAssetAtPath<ShrinkTutorialSettings>(SettingsPath);
-12
View File
@@ -22,12 +22,6 @@ namespace ShrinkTutorial.Editor
window.Show();
}
[MenuItem("ShrinkSDK/Tutorial/Editor")]
public static void ShowWindowAlias()
{
ShowWindow();
}
[MenuItem("ShrinkSDK/引导/重置教程进度")]
public static void ResetProgress()
{
@@ -37,12 +31,6 @@ namespace ShrinkTutorial.Editor
Debug.Log("[ShrinkTutorial] 已重置教程进度。");
}
[MenuItem("ShrinkSDK/Tutorial/Reset Progress")]
public static void ResetProgressAlias()
{
ResetProgress();
}
private void OnEnable()
{
TryAssignDefaultDatabase();
+1 -1
View File
@@ -3,7 +3,7 @@ using UnityEngine;
namespace ShrinkTutorial
{
[CreateAssetMenu(fileName = "ShrinkTutorialData", menuName = "ShrinkTutorial/Tutorial Data")]
[CreateAssetMenu(fileName = "ShrinkTutorialData", menuName = "ShrinkSDK/引导/教程数据")]
public class ShrinkTutorialData : ScriptableObject
{
public string tutorialId = string.Empty;
+1 -1
View File
@@ -3,7 +3,7 @@ using UnityEngine;
namespace ShrinkTutorial
{
[CreateAssetMenu(fileName = "ShrinkTutorialDatabase", menuName = "ShrinkTutorial/Tutorial Database")]
[CreateAssetMenu(fileName = "ShrinkTutorialDatabase", menuName = "ShrinkSDK/引导/教程数据库")]
public class ShrinkTutorialDatabase : ScriptableObject
{
[SerializeField] private List<ShrinkTutorialData> tutorials = new();
+1 -1
View File
@@ -2,7 +2,7 @@ using UnityEngine;
namespace ShrinkTutorial
{
[CreateAssetMenu(fileName = "ShrinkTutorialSettings", menuName = "ShrinkTutorial/Settings")]
[CreateAssetMenu(fileName = "ShrinkTutorialSettings", menuName = "ShrinkSDK/引导/引导设置")]
public class ShrinkTutorialSettings : ScriptableObject
{
private static ShrinkTutorialSettings _instance;
+3 -2
View File
@@ -1,13 +1,14 @@
{
"name": "com.cneicy.shrink-tutorial",
"version": "0.1.0",
"version": "0.1.2",
"displayName": "ShrinkTutorial",
"description": "面向 Unity 的互动式新手引导系统,提供数据驱动教程、遮罩挖洞、动态锚点、步骤条件与运行时调度。",
"unity": "2022.3",
"dependencies": {
"com.unity.textmeshpro": "3.0.7",
"com.unity.ugui": "1.0.0",
"com.unity.modules.physics": "1.0.0"
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"keywords": [
"tutorial",