fix: improve CI build robustness with better stubs and paths
This commit is contained in:
@@ -20,7 +20,7 @@ jobs:
|
|||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v4
|
uses: actions/setup-dotnet@v4
|
||||||
with:
|
with:
|
||||||
dotnet-version: 6.0.x
|
dotnet-version: 8.0.x
|
||||||
|
|
||||||
- name: Set Version
|
- name: Set Version
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
@@ -31,13 +31,24 @@ jobs:
|
|||||||
echo "Building gregFramework version $version"
|
echo "Building gregFramework version $version"
|
||||||
|
|
||||||
# 1. Build gregCore
|
# 1. Build gregCore
|
||||||
# Hinweis: In CI müssen ggf. Stubs für MelonLoader/Il2Cpp vorhanden sein.
|
|
||||||
- name: Build gregCore
|
- name: Build gregCore
|
||||||
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
if (Test-Path "ci-stubs/create-stubs.sh") { bash ci-stubs/create-stubs.sh }
|
if (Test-Path "ci-stubs/create-stubs.sh") {
|
||||||
|
# Use bash (from Git for Windows) to run the stub script
|
||||||
|
bash ci-stubs/create-stubs.sh
|
||||||
|
}
|
||||||
dotnet build src/gregCore.csproj -c Release -p:Version=${{ env.VERSION }} -p:CI=true
|
dotnet build src/gregCore.csproj -c Release -p:Version=${{ env.VERSION }} -p:CI=true
|
||||||
|
|
||||||
# 2. Prepare Assets
|
# 2. Build gregExtractor (Optional, only if in this repo)
|
||||||
|
- name: Publish gregExtractor
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
if (Test-Path "gregExtractor/gregExtractor.csproj") {
|
||||||
|
dotnet publish gregExtractor/gregExtractor.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:Version=${{ env.VERSION }} -o publish/extractor
|
||||||
|
}
|
||||||
|
|
||||||
|
# 3. Prepare Assets
|
||||||
- name: Prepare Assets
|
- name: Prepare Assets
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
@@ -50,6 +61,13 @@ jobs:
|
|||||||
Copy-Item $coreDll $releaseDir/
|
Copy-Item $coreDll $releaseDir/
|
||||||
Compress-Archive -Path $coreDll, "README.md" -DestinationPath "$releaseDir/gregCore-v${{ env.VERSION }}.zip"
|
Compress-Archive -Path $coreDll, "README.md" -DestinationPath "$releaseDir/gregCore-v${{ env.VERSION }}.zip"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# gregExtractor
|
||||||
|
$extractorExe = "publish/extractor/gregExtractor.exe"
|
||||||
|
if (Test-Path $extractorExe) {
|
||||||
|
Copy-Item $extractorExe $releaseDir/
|
||||||
|
Compress-Archive -Path "publish/extractor/*" -DestinationPath "$releaseDir/gregExtractor-v${{ env.VERSION }}.zip"
|
||||||
|
}
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
|||||||
@@ -2,4 +2,29 @@
|
|||||||
# Erzeugt leere Stub-DLLs für CI-Build ohne echtes MelonLoader
|
# Erzeugt leere Stub-DLLs für CI-Build ohne echtes MelonLoader
|
||||||
# Diese enthalten nur die nötigen Type-Definitionen
|
# Diese enthalten nur die nötigen Type-Definitionen
|
||||||
|
|
||||||
dotnet new classlib -n MelonLoaderStub -f net6.0
|
mkdir -p ci-stubs
|
||||||
|
cd ci-stubs
|
||||||
|
|
||||||
|
ASSEMBLIES=(
|
||||||
|
"MelonLoader"
|
||||||
|
"Il2CppInterop.Runtime"
|
||||||
|
"Il2CppInterop.Common"
|
||||||
|
"0Harmony"
|
||||||
|
"Assembly-CSharp"
|
||||||
|
"Il2Cppmscorlib"
|
||||||
|
"UnityEngine.CoreModule"
|
||||||
|
"UnityEngine.IMGUIModule"
|
||||||
|
"UnityEngine.UIModule"
|
||||||
|
"UnityEngine.InputLegacyModule"
|
||||||
|
)
|
||||||
|
|
||||||
|
for asm in "${ASSEMBLIES[@]}"; do
|
||||||
|
if [ ! -f "$asm.dll" ]; then
|
||||||
|
echo "Creating stub for $asm..."
|
||||||
|
dotnet new classlib -n "$asm" -f net6.0 --force
|
||||||
|
dotnet build "$asm/$asm.csproj" -c Release -o .
|
||||||
|
rm -rf "$asm"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Stubs created in $(pwd)"
|
||||||
|
|||||||
+24
-16
@@ -6,6 +6,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
|
||||||
|
<RepoRoot>$(MSBuildProjectDirectory)\..</RepoRoot>
|
||||||
<AssemblyName>gregCore</AssemblyName>
|
<AssemblyName>gregCore</AssemblyName>
|
||||||
<RootNamespace>gregCore</RootNamespace>
|
<RootNamespace>gregCore</RootNamespace>
|
||||||
<Version>1.0.0.33-pre</Version>
|
<Version>1.0.0.33-pre</Version>
|
||||||
@@ -20,48 +21,55 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="MelonLoader" Condition="'$(CI)' != 'true'">
|
<!-- Common References with CI Fallback -->
|
||||||
<HintPath>$(MELON_BASE_DIR)\net6\MelonLoader.dll</HintPath>
|
<Reference Include="MelonLoader">
|
||||||
<Private>False</Private>
|
<HintPath Condition="'$(CI)' != 'true'">$(MELON_BASE_DIR)\net6\MelonLoader.dll</HintPath>
|
||||||
</Reference>
|
<HintPath Condition="'$(CI)' == 'true'">$(RepoRoot)\ci-stubs\MelonLoader.dll</HintPath>
|
||||||
<Reference Include="MelonLoader" Condition="'$(CI)' == 'true'">
|
|
||||||
<HintPath>$(RepoRoot)\ci-stubs\MelonLoader.dll</HintPath>
|
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Il2CppInterop.Runtime">
|
<Reference Include="Il2CppInterop.Runtime">
|
||||||
<HintPath>$(MELON_BASE_DIR)\net6\Il2CppInterop.Runtime.dll</HintPath>
|
<HintPath Condition="'$(CI)' != 'true'">$(MELON_BASE_DIR)\net6\Il2CppInterop.Runtime.dll</HintPath>
|
||||||
|
<HintPath Condition="'$(CI)' == 'true'">$(RepoRoot)\ci-stubs\Il2CppInterop.Runtime.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Il2CppInterop.Common">
|
<Reference Include="Il2CppInterop.Common">
|
||||||
<HintPath>$(MELON_BASE_DIR)\net6\Il2CppInterop.Common.dll</HintPath>
|
<HintPath Condition="'$(CI)' != 'true'">$(MELON_BASE_DIR)\net6\Il2CppInterop.Common.dll</HintPath>
|
||||||
|
<HintPath Condition="'$(CI)' == 'true'">$(RepoRoot)\ci-stubs\Il2CppInterop.Common.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="0Harmony">
|
<Reference Include="0Harmony">
|
||||||
<HintPath>$(MELON_BASE_DIR)\net6\0Harmony.dll</HintPath>
|
<HintPath Condition="'$(CI)' != 'true'">$(MELON_BASE_DIR)\net6\0Harmony.dll</HintPath>
|
||||||
|
<HintPath Condition="'$(CI)' == 'true'">$(RepoRoot)\ci-stubs\0Harmony.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Assembly-CSharp">
|
<Reference Include="Assembly-CSharp">
|
||||||
<HintPath>$(MELON_BASE_DIR)\Il2CppAssemblies\Assembly-CSharp.dll</HintPath>
|
<HintPath Condition="'$(CI)' != 'true'">$(MELON_BASE_DIR)\Il2CppAssemblies\Assembly-CSharp.dll</HintPath>
|
||||||
|
<HintPath Condition="'$(CI)' == 'true'">$(RepoRoot)\ci-stubs\Assembly-CSharp.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Il2Cppmscorlib">
|
<Reference Include="Il2Cppmscorlib">
|
||||||
<HintPath>$(MELON_BASE_DIR)\Il2CppAssemblies\Il2Cppmscorlib.dll</HintPath>
|
<HintPath Condition="'$(CI)' != 'true'">$(MELON_BASE_DIR)\Il2CppAssemblies\Il2Cppmscorlib.dll</HintPath>
|
||||||
|
<HintPath Condition="'$(CI)' == 'true'">$(RepoRoot)\ci-stubs\Il2Cppmscorlib.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.CoreModule">
|
<Reference Include="UnityEngine.CoreModule">
|
||||||
<HintPath>$(MELON_BASE_DIR)\Il2CppAssemblies\UnityEngine.CoreModule.dll</HintPath>
|
<HintPath Condition="'$(CI)' != 'true'">$(MELON_BASE_DIR)\Il2CppAssemblies\UnityEngine.CoreModule.dll</HintPath>
|
||||||
|
<HintPath Condition="'$(CI)' == 'true'">$(RepoRoot)\ci-stubs\UnityEngine.CoreModule.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.IMGUIModule">
|
<Reference Include="UnityEngine.IMGUIModule">
|
||||||
<HintPath>$(MELON_BASE_DIR)\Il2CppAssemblies\UnityEngine.IMGUIModule.dll</HintPath>
|
<HintPath Condition="'$(CI)' != 'true'">$(MELON_BASE_DIR)\Il2CppAssemblies\UnityEngine.IMGUIModule.dll</HintPath>
|
||||||
|
<HintPath Condition="'$(CI)' == 'true'">$(RepoRoot)\ci-stubs\UnityEngine.IMGUIModule.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.UIModule">
|
<Reference Include="UnityEngine.UIModule">
|
||||||
<HintPath>$(MELON_BASE_DIR)\Il2CppAssemblies\UnityEngine.UIModule.dll</HintPath>
|
<HintPath Condition="'$(CI)' != 'true'">$(MELON_BASE_DIR)\Il2CppAssemblies\UnityEngine.UIModule.dll</HintPath>
|
||||||
|
<HintPath Condition="'$(CI)' == 'true'">$(RepoRoot)\ci-stubs\UnityEngine.UIModule.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.InputLegacyModule">
|
<Reference Include="UnityEngine.InputLegacyModule">
|
||||||
<HintPath>$(MELON_BASE_DIR)\Il2CppAssemblies\UnityEngine.InputLegacyModule.dll</HintPath>
|
<HintPath Condition="'$(CI)' != 'true'">$(MELON_BASE_DIR)\Il2CppAssemblies\UnityEngine.InputLegacyModule.dll</HintPath>
|
||||||
|
<HintPath Condition="'$(CI)' == 'true'">$(RepoRoot)\ci-stubs\UnityEngine.InputLegacyModule.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -71,4 +79,4 @@
|
|||||||
<PackageReference Include="MoonSharp" Version="2.0.0.0" />
|
<PackageReference Include="MoonSharp" Version="2.0.0.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user