Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbba140fd6 | ||
|
|
b2ce5637a0 | ||
|
|
b589f2a385 | ||
|
|
e279c4230e | ||
|
|
61b7c4da73 | ||
|
|
98c43fc193 | ||
|
|
4b843ea337 |
@@ -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/
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,13 +1,14 @@
|
||||
{
|
||||
"name": "com.cneicy.shrink-tutorial",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"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",
|
||||
|
||||
Reference in New Issue
Block a user