Compare commits
10
Commits
b505c5ebb1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30a6a11344 | ||
|
|
9e92d38a53
|
||
|
|
3650f9c08b
|
||
|
|
907dda3c8e
|
||
|
|
b039efb813
|
||
|
|
302c10b687
|
||
|
|
84b976c70e
|
||
|
|
93f66eaa0b
|
||
|
|
87f7b2e408
|
||
|
|
d963c03081
|
@@ -14,38 +14,109 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
env:
|
env:
|
||||||
NUGET_AUTH_TOKEN: ${{ secrets.SHRINKSDK_PACKAGE_TOKEN }}
|
NUGET_AUTH_TOKEN: ${{ secrets.SHRINKSDK_PACKAGE_TOKEN }}
|
||||||
|
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: '1'
|
||||||
|
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
|
||||||
|
LD_LIBRARY_PATH: /opt/dotnet-libs/usr/lib/x86_64-linux-gnu
|
||||||
|
SSL_CERT_FILE: /opt/ca-certificates.crt
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout tagged source
|
- name: Fetch exact tagged source
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up .NET
|
|
||||||
uses: actions/setup-dotnet@v4
|
|
||||||
with:
|
|
||||||
dotnet-version: '8.0.x'
|
|
||||||
|
|
||||||
- name: Validate tag and pack projects
|
|
||||||
env:
|
env:
|
||||||
GITEA_REF: ${{ gitea.ref }}
|
GITEA_REF: ${{ gitea.ref }}
|
||||||
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
tag="${GITEA_REF#refs/tags/}"
|
tag="${GITEA_REF#refs/tags/}"
|
||||||
version="$(node -p "require('./package.json').version")"
|
case "$tag" in
|
||||||
test "$tag" = "v$version"
|
v[0-9]*) ;;
|
||||||
mkdir -p packages
|
*) echo "Expected a version tag ref, got: $GITEA_REF" >&2; exit 1 ;;
|
||||||
mapfile -d '' projects < <(find DotNet~ Godot~ -type f -name '*.csproj' -print0 2>/dev/null || true)
|
esac
|
||||||
test "${#projects[@]}" -gt 0
|
export SHRINKSDK_ARCHIVE_URL="https://git.crash.work/${GITEA_REPOSITORY}/archive/${tag}.tar.gz"
|
||||||
for project in "${projects[@]}"; do
|
node --input-type=module <<'NODE'
|
||||||
dotnet restore "$project" --configfile NuGet.Config
|
import { writeFile } from 'node:fs/promises';
|
||||||
dotnet pack "$project" --configuration Release --no-restore --output "$PWD/packages" --include-symbols --include-source
|
|
||||||
done
|
|
||||||
find packages -maxdepth 1 -name '*.nupkg' -type f | grep -q .
|
|
||||||
|
|
||||||
- name: Publish packages
|
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: Install .NET 8 SDK
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
node --input-type=module <<'NODE'
|
||||||
|
import { writeFile } from 'node:fs/promises';
|
||||||
|
import { rootCertificates } from 'node:tls';
|
||||||
|
|
||||||
|
await writeFile('/opt/ca-certificates.crt', rootCertificates.join('\n'));
|
||||||
|
|
||||||
|
const metadataResponse = await fetch('https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/8.0/releases.json');
|
||||||
|
if (!metadataResponse.ok) throw new Error(`Release metadata download failed: ${metadataResponse.status}`);
|
||||||
|
const metadata = await metadataResponse.json();
|
||||||
|
const sdkVersion = metadata['latest-sdk'];
|
||||||
|
const release = metadata.releases.find(item => item.sdk?.version === sdkVersion);
|
||||||
|
const file = release?.sdk?.files?.find(item => item.rid === 'linux-x64' && item.name.endsWith('.tar.gz'));
|
||||||
|
if (!file) throw new Error(`Linux x64 SDK archive not found for ${sdkVersion}`);
|
||||||
|
const archiveResponse = await fetch(file.url);
|
||||||
|
if (!archiveResponse.ok) throw new Error(`SDK download failed: ${archiveResponse.status}`);
|
||||||
|
await writeFile('/tmp/dotnet-sdk.tar.gz', new Uint8Array(await archiveResponse.arrayBuffer()));
|
||||||
|
|
||||||
|
const poolUrl = 'https://deb.debian.org/debian-security/pool/updates/main/o/openssl/';
|
||||||
|
const poolResponse = await fetch(poolUrl);
|
||||||
|
if (!poolResponse.ok) throw new Error(`OpenSSL package index download failed: ${poolResponse.status}`);
|
||||||
|
const poolIndex = await poolResponse.text();
|
||||||
|
const packages = [...poolIndex.matchAll(/href="(libssl3_[^"]+_amd64\.deb)"/g)].map(match => match[1]).sort();
|
||||||
|
const packageName = packages.at(-1);
|
||||||
|
if (!packageName) throw new Error('Debian libssl3 package was not found');
|
||||||
|
const packageResponse = await fetch(poolUrl + packageName);
|
||||||
|
if (!packageResponse.ok) throw new Error(`OpenSSL package download failed: ${packageResponse.status}`);
|
||||||
|
await writeFile('/tmp/libssl3.deb', new Uint8Array(await packageResponse.arrayBuffer()));
|
||||||
|
NODE
|
||||||
|
mkdir -p /opt/dotnet
|
||||||
|
tar -xzf /tmp/dotnet-sdk.tar.gz -C /opt/dotnet
|
||||||
|
mkdir -p /opt/dotnet-libs
|
||||||
|
dpkg-deb -x /tmp/libssl3.deb /opt/dotnet-libs
|
||||||
|
rm -f /tmp/dotnet-sdk.tar.gz
|
||||||
|
rm -f /tmp/libssl3.deb
|
||||||
|
/opt/dotnet/dotnet --info
|
||||||
|
|
||||||
|
- name: Validate, pack and publish
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
: "${NUGET_AUTH_TOKEN:?SHRINKSDK_PACKAGE_TOKEN is required}"
|
: "${NUGET_AUTH_TOKEN:?SHRINKSDK_PACKAGE_TOKEN is required}"
|
||||||
|
export PATH="/opt/dotnet:$PATH"
|
||||||
|
cd release
|
||||||
|
tag="$(cat .shrink-sdk-release-tag)"
|
||||||
|
projects=()
|
||||||
|
if [[ -d DotNet~ ]]; then
|
||||||
|
while IFS= read -r -d '' project; do projects+=("$project"); done < <(find DotNet~ -type f -name '*.csproj' -print0)
|
||||||
|
fi
|
||||||
|
if [[ -d Godot~ ]]; then
|
||||||
|
while IFS= read -r -d '' project; do projects+=("$project"); done < <(find Godot~ -type f -name '*.csproj' -print0)
|
||||||
|
fi
|
||||||
|
if [[ "${#projects[@]}" -eq 0 ]]; then
|
||||||
|
while IFS= read -r -d '' project; do projects+=("$project"); done < <(find . -maxdepth 1 -type f -name '*.csproj' -print0)
|
||||||
|
fi
|
||||||
|
test "${#projects[@]}" -gt 0
|
||||||
|
if [[ -f package.json ]]; then
|
||||||
|
version="$(node -p "require('./package.json').version")"
|
||||||
|
else
|
||||||
|
version="$(dotnet msbuild "${projects[0]}" -getProperty:Version -nologo)"
|
||||||
|
fi
|
||||||
|
test "$tag" = "v$version"
|
||||||
|
mkdir -p packages
|
||||||
|
for project in "${projects[@]}"; do
|
||||||
|
dotnet restore "$project" --configfile NuGet.Config
|
||||||
|
dotnet pack "$project" --configuration Release --no-restore --output "$PWD/packages"
|
||||||
|
done
|
||||||
|
find packages -maxdepth 1 -name '*.nupkg' -type f | grep -q .
|
||||||
dotnet nuget push 'packages/*.nupkg' --api-key "$NUGET_AUTH_TOKEN" --source https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json --skip-duplicate
|
dotnet nuget push 'packages/*.nupkg' --api-key "$NUGET_AUTH_TOKEN" --source https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json --skip-duplicate
|
||||||
if compgen -G 'packages/*.snupkg' > /dev/null; then
|
if compgen -G 'packages/*.snupkg' > /dev/null; then
|
||||||
dotnet nuget push 'packages/*.snupkg' --api-key "$NUGET_AUTH_TOKEN" --source https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json --skip-duplicate
|
dotnet nuget push 'packages/*.snupkg' --api-key "$NUGET_AUTH_TOKEN" --source https://git.crash.work/api/packages/ShrinkSDK/nuget/index.json --skip-duplicate
|
||||||
|
|||||||
@@ -10,3 +10,5 @@ DotNet~/
|
|||||||
Godot~/
|
Godot~/
|
||||||
NuGet.Config
|
NuGet.Config
|
||||||
Directory.Build.props
|
Directory.Build.props
|
||||||
|
NuGet.Config.meta
|
||||||
|
Directory.Build.props.meta
|
||||||
|
|||||||
@@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
本文件记录 `ShrinkInstaller` 的包内变更。
|
本文件记录 `ShrinkInstaller` 的包内变更。
|
||||||
|
|
||||||
|
## [0.2.6] - 2026-09-05
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- 将 `ShrinkEventBus.Entities` 目录版本更新到 `0.1.2`。
|
||||||
|
|
||||||
## [0.2.5] - 2026-09-05
|
## [0.2.5] - 2026-09-05
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: eda4b5bf19b0ba449900782335d92871
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -93,7 +93,7 @@ namespace ShrinkSDK.Installer
|
|||||||
"com.cneicy.shrink-eventbus", "2.1.0", ShrinkSdkPackageLayer.Feature, true);
|
"com.cneicy.shrink-eventbus", "2.1.0", ShrinkSdkPackageLayer.Feature, true);
|
||||||
internal static readonly ShrinkSdkPackageEntry EventBusEntities = Package(
|
internal static readonly ShrinkSdkPackageEntry EventBusEntities = Package(
|
||||||
"Entities 事件适配", "将事件总线接入 Unity Entities。",
|
"Entities 事件适配", "将事件总线接入 Unity Entities。",
|
||||||
"com.cneicy.shrink-eventbus-entities", "0.1.1", ShrinkSdkPackageLayer.Integration, true);
|
"com.cneicy.shrink-eventbus-entities", "0.1.2", ShrinkSdkPackageLayer.Integration, true);
|
||||||
internal static readonly ShrinkSdkPackageEntry ModFramework = Package(
|
internal static readonly ShrinkSdkPackageEntry ModFramework = Package(
|
||||||
"模组框架", "Context 托管的模组生命周期、热替换与外部 DLL 加载。",
|
"模组框架", "Context 托管的模组生命周期、热替换与外部 DLL 加载。",
|
||||||
"com.cneicy.shrink-mod-framework", "0.3.0", ShrinkSdkPackageLayer.Feature, true);
|
"com.cneicy.shrink-mod-framework", "0.3.0", ShrinkSdkPackageLayer.Feature, true);
|
||||||
|
|||||||
@@ -4,16 +4,19 @@
|
|||||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||||
<AssemblyName>ShrinkSDK.Godot.Installer</AssemblyName>
|
<AssemblyName>ShrinkSDK.Godot.Installer</AssemblyName>
|
||||||
<PackageId>ShrinkSDK.Godot.Installer</PackageId>
|
<PackageId>ShrinkSDK.Godot.Installer</PackageId>
|
||||||
<Version>0.1.1</Version>
|
<Version>0.1.3</Version>
|
||||||
<Description>Godot Editor package manager and CodeGen diagnostics for ShrinkSDK.</Description>
|
<Description>Godot Editor package manager and CodeGen diagnostics for ShrinkSDK.</Description>
|
||||||
|
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||||||
|
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
|
||||||
|
<IncludeSymbols>false</IncludeSymbols>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="addons\shrinksdk\*.cs" />
|
<Compile Include="addons\shrinksdk\*.cs" />
|
||||||
<Compile Include="..\Editor\ShrinkPackageVersion.cs" Link="addons\shrinksdk\ShrinkPackageVersion.cs" />
|
<Compile Include="..\Editor\ShrinkPackageVersion.cs" Link="addons\shrinksdk\ShrinkPackageVersion.cs" />
|
||||||
<PackageReference Include="GodotSharp" Version="4.6.3" />
|
<PackageReference Include="GodotSharp" Version="4.6.3" />
|
||||||
<PackageReference Include="GodotSharpEditor" Version="4.6.3" />
|
<PackageReference Include="GodotSharpEditor" Version="4.6.3" />
|
||||||
<None Include="addons\shrinksdk\plugin.cfg" Pack="true" PackagePath="contentFiles\any\any\addons\shrinksdk\plugin.cfg" />
|
<None Include="addons\shrinksdk\plugin.cfg" Pack="true" PackagePath="contentFiles\any\any\addons\shrinksdk\plugin.cfg" BuildAction="None" />
|
||||||
<None Include="addons\shrinksdk\*.cs" Pack="true" PackagePath="contentFiles\any\any\addons\shrinksdk\" />
|
<None Include="addons\shrinksdk\*.cs" Pack="true" PackagePath="contentFiles\any\any\addons\shrinksdk" BuildAction="None" />
|
||||||
<None Include="..\Editor\ShrinkPackageVersion.cs" Pack="true" PackagePath="contentFiles\any\any\addons\shrinksdk\ShrinkPackageVersion.cs" />
|
<None Include="..\Editor\ShrinkPackageVersion.cs" Pack="true" PackagePath="contentFiles\any\any\addons\shrinksdk\ShrinkPackageVersion.cs" BuildAction="None" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7ce6566e89a950f489641c299d7bd7d6
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
- first:
|
||||||
|
Windows Store Apps: WindowsStoreApps
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -22,10 +22,10 @@ https://git.crash.work/ShrinkSDK/Installer.git#main
|
|||||||
|
|
||||||
## Godot 4.6 C#
|
## Godot 4.6 C#
|
||||||
|
|
||||||
Godot Installer 源码和 NuGet 打包工程位于 `Godot~`。安装 `ShrinkSDK.Godot.Installer 0.1.1` 后,将包内 `contentFiles/any/any/addons/shrinksdk` 复制到 Godot 项目的 `addons/shrinksdk`,再到 `Project > Project Settings > Plugins` 启用 **ShrinkSDK Installer**。
|
Godot Installer 源码和 NuGet 打包工程位于 `Godot~`。取得 `ShrinkSDK.Godot.Installer 0.1.3` 后,将包内 `contentFiles/any/any/addons/shrinksdk` 复制到 Godot 项目的 `addons/shrinksdk`,再到 `Project > Project Settings > Plugins` 启用 **ShrinkSDK Installer**。
|
||||||
|
|
||||||
Godot 面板直接修改项目 `.csproj` 的 `PackageReference`,安全合并项目级 `NuGet.Config`,并可执行 `dotnet restore/build`、显示 CodeGen 织入状态。已安装版本高于目录版本时不会执行降级。
|
Godot 面板直接修改项目 `.csproj` 的 `PackageReference`,安全合并项目级 `NuGet.Config`,并可执行 `dotnet restore/build`、显示 CodeGen 织入状态。已安装版本高于目录版本时不会执行降级。
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
dotnet pack .\Godot~\ShrinkSDK.Godot.Installer.csproj -c Release --output .\artifacts --include-symbols --include-source
|
dotnet pack .\Godot~\ShrinkSDK.Godot.Installer.csproj -c Release --output .\artifacts
|
||||||
```
|
```
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "com.cneicy.shrink-installer",
|
"name": "com.cneicy.shrink-installer",
|
||||||
"version": "0.2.5",
|
"version": "0.2.6",
|
||||||
"displayName": "ShrinkSDK 包管理",
|
"displayName": "ShrinkSDK 包管理",
|
||||||
"description": "基于 UI Toolkit 的 ShrinkSDK 固定版本包管理器,提供安装状态、Context 分层与推荐组合。",
|
"description": "基于 UI Toolkit 的 ShrinkSDK 固定版本包管理器,提供安装状态、Context 分层与推荐组合。",
|
||||||
"unity": "2022.3",
|
"unity": "2022.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user