Jelajahi Sumber

【维护】版本号升至 0.1.1 并校验发布版本一致

发布 v0.1.1,包含事件驱动改造与配置变更防抖两项改进。

- csproj Version 与 BepInPlugin 版本同步升至 0.1.1。
- release.sh 新增校验:BepInPlugin 版本必须与 csproj 一致,避免两处漂移。
PJ568 1 bulan lalu
induk
melakukan
c762a84d62

+ 9 - 0
scripts/release.sh

@@ -18,6 +18,15 @@ fi
 # 从 csproj 读取版本号 / Read the version from the csproj
 VERSION="$(sed -n 's:.*<Version>\(.*\)</Version>.*:\1:p' src/PerformanceScope.Plugin/PerformanceScope.Plugin.csproj | head -1)"
 [ -n "$VERSION" ] || { echo "错误:未能从 csproj 读取 Version | Error: cannot read Version from csproj" >&2; exit 1; }
+
+# 校验 BepInPlugin 特性里的版本与 csproj 一致,避免两处漂移
+# Verify the BepInPlugin version matches the csproj so the two cannot drift apart
+PLUGIN_VERSION="$(grep -oE '\[BepInPlugin\([^]]*' src/PerformanceScope.Plugin/Plugin.cs | grep -oE '"[0-9]+\.[0-9]+\.[0-9]+"' | tr -d '"' | tail -1)"
+if [ -n "$PLUGIN_VERSION" ] && [ "$PLUGIN_VERSION" != "$VERSION" ]; then
+  echo "错误:BepInPlugin 版本 $PLUGIN_VERSION 与 csproj 版本 $VERSION 不一致 | Error: BepInPlugin version $PLUGIN_VERSION does not match csproj version $VERSION" >&2
+  exit 1
+fi
+
 TAG="v$VERSION"
 
 # 工作区必须干净,避免发布内容与提交不一致

+ 1 - 1
src/PerformanceScope.Plugin/PerformanceScope.Plugin.csproj

@@ -5,7 +5,7 @@
     <AssemblyName>PerformanceScope</AssemblyName>
     <RootNamespace>PerformanceScope</RootNamespace>
     <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
-    <Version>0.1.0</Version>
+    <Version>0.1.1</Version>
   </PropertyGroup>
 
   <!-- 共享纯逻辑:与测试工程同源编译,避免多出一个运行时依赖 dll -->

+ 1 - 1
src/PerformanceScope.Plugin/Plugin.cs

@@ -16,7 +16,7 @@ namespace PerformanceScope
     /// config changes are debounced here before being handed to the service, while events such as scope exit are
     /// subscribed by the service itself. This plugin offers no custom UI or hotkey.
     /// </summary>
-    [BepInPlugin("com.pj568.performancescope", "PerformanceScope", "0.1.0")]
+    [BepInPlugin("com.pj568.performancescope", "PerformanceScope", "0.1.1")]
     public class PerformanceScopePlugin : BaseUnityPlugin
     {
         private const string HarmonyId = "com.pj568.performancescope";