@@ -17,16 +17,64 @@ jobs:
1717 uses : actions/setup-dotnet@v4
1818 with :
1919 dotnet-version : ' 10.0.x'
20-
21- # IMPORTANT: Add step to handle ETABSv1.dll reference
22- - name : Create dummy ETABSv1.dll reference
20+
21+ # SOLUTION 1: Create minimal stub assembly
22+ - name : Create stub ETABSv1.dll
2323 run : |
24- # Create a minimal reference assembly for build
25- # This allows the package to build without ETABS installed
26- $dllPath = "C:\Program Files\Computers and Structures\ETABS 22"
27- if (-not (Test-Path $dllPath)) {
28- New-Item -ItemType Directory -Force -Path $dllPath
29- # Copy from a known location or skip if not needed for build
24+ # Create directory for ETABS DLL
25+ $etabsPath = "C:\Program Files\Computers and Structures\ETABS 22"
26+ New-Item -ItemType Directory -Force -Path $etabsPath | Out-Null
27+
28+ # Create minimal IL code for stub assembly
29+ $ilCode = @'
30+ .assembly extern mscorlib {}
31+ .assembly extern System.Runtime { .ver 4:0:0:0 }
32+
33+ .assembly ETABSv1
34+ {
35+ .ver 1:0:0:0
36+ .hash algorithm 0x00008004
37+ }
38+
39+ .module ETABSv1.dll
40+
41+ // Minimal type to make assembly valid
42+ .class public auto ansi beforefieldinit ETABSv1.Helper
43+ extends [mscorlib]System.Object
44+ {
45+ .method public hidebysig specialname rtspecialname
46+ instance void .ctor() cil managed
47+ {
48+ .maxstack 8
49+ ldarg.0
50+ call instance void [mscorlib]System.Object::.ctor()
51+ ret
52+ }
53+ }
54+ ' @
55+
56+ # Save IL code to file
57+ $ilFile = Join-Path $env:TEMP "ETABSv1.il"
58+ $ilCode | Out-File -FilePath $ilFile -Encoding ASCII
59+
60+ # Find ilasm.exe
61+ $ilasmPath = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ilasm.exe"
62+
63+ if (Test-Path $ilasmPath) {
64+ # Compile to DLL
65+ $dllPath = Join-Path $etabsPath "ETABSv1.dll"
66+ & $ilasmPath /DLL /QUIET /OUTPUT="$dllPath" $ilFile
67+
68+ if (Test-Path $dllPath) {
69+ Write-Host "✓ Stub ETABSv1.dll created successfully at: $dllPath"
70+ Write-Host " File size: $((Get-Item $dllPath).Length) bytes"
71+ } else {
72+ Write-Error "Failed to create ETABSv1.dll"
73+ exit 1
74+ }
75+ } else {
76+ Write-Error "ilasm.exe not found at: $ilasmPath"
77+ exit 1
3078 }
3179 shell: pwsh
3280
3785 run: dotnet build --configuration Release --no-restore
3886
3987 - name: Run tests
40- run : dotnet test --configuration Release --no-build
41- continue-on-error : true # Tests might fail without ETABS
88+ run: dotnet test --configuration Release --no-build --verbosity normal
89+ continue-on-error: true # Tests may fail without actual ETABS
4290
4391 - name: Extract version from tag
4492 id: version
@@ -57,9 +105,16 @@ jobs:
57105 run : |
58106 $version = "${{ steps.version.outputs.version }}"
59107 $csprojPath = "src\EtabSharp\EtabSharp.csproj"
60- $xml = [xml](Get-Content $csprojPath)
61- $xml.Project.PropertyGroup[0].Version = $version
62- $xml.Save($csprojPath)
108+
109+ if (Test-Path $csprojPath) {
110+ $xml = [xml](Get-Content $csprojPath)
111+ $xml.Project.PropertyGroup[0].Version = $version
112+ $xml.Save($csprojPath)
113+ Write-Host "✓ Updated version to $version in $csprojPath"
114+ } else {
115+ Write-Error "Project file not found: $csprojPath"
116+ exit 1
117+ }
63118
64119 - name : Pack NuGet package
65120 run : dotnet pack src/EtabSharp/EtabSharp.csproj --configuration Release --output nuget --no-build
74129 token : ${{ secrets.GITHUB_TOKEN }}
75130 draft : false
76131 prerelease : ${{ steps.version.outputs.is_prerelease == 'true' }}
77- generateReleaseNotes : true
132+ generateReleaseNotes : true
133+
134+ ---
0 commit comments