88 branches : [ "master" ]
99 workflow_dispatch :
1010
11+ env :
12+ DOTNET_RUNTIME : net8.0
13+ SETUP_DOTNET_VERSION : 8.0.x
14+
15+ BEAENGINE_TAG : v5.3.0
16+
1117jobs :
1218 build-windows :
1319 name : Build Windows artifacts
@@ -27,20 +33,70 @@ jobs:
2733 if ($LASTEXITCODE) { exit $LASTEXITCODE }
2834 Remove-Item Release\net48\*.pdb, Release\net48\*.xml, Release\net48\Test.Rename.*
2935
30- dotnet publish -c Release -f net8.0 -o publish-net8.0 de4dot
31- Remove-Item publish-net8.0\*.pdb, publish-net8.0\*.xml
36+ dotnet publish -c Release -f $env:DOTNET_RUNTIME -o publish-$env:DOTNET_RUNTIME de4dot
37+ Remove-Item publish-$env:DOTNET_RUNTIME\*.pdb, publish-$env:DOTNET_RUNTIME\*.xml
38+
39+ - name : Build BeaEngine
40+ shell : pwsh
41+ run : |
42+ $ErrorActionPreference = 'Stop'
43+
44+ git clone --depth 1 --branch $env:BEAENGINE_TAG https://github.com/BeaEngine/beaengine.git beaengine
45+
46+ # Remove cmake malpractice
47+ (Get-Content beaengine/CMakeLists.txt) |
48+ Where-Object { $_ -notmatch '\s*list\s*\(APPEND\s+BEA_FLAGS\s+/M' } |
49+ Set-Content beaengine/CMakeLists.txt
50+
51+ # Win32 for .NET 4.8
52+ cmake -S beaengine -B build-beaengine-32 `
53+ -A Win32 `
54+ -DoptBUILD_DLL=ON `
55+ -DoptHAS_OPTIMIZED=ON `
56+ -DoptHAS_SYMBOLS=OFF `
57+ -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
58+
59+ cmake --build build-beaengine-32 --config Release
60+
61+ $dll32 = Get-ChildItem -Recurse build-beaengine-32 -Filter BeaEngine*.dll | Select-Object -First 1
62+
63+ if (-not $dll32) {
64+ throw "32-bit BeaEngine.dll not found"
65+ }
66+
67+ Copy-Item $dll32.FullName Release/net48/BeaEngine.dll
68+ Copy-Item beaengine/src/COPYING.txt Release/net48/LICENSES/LICENSE.BeaEngine.GPL.txt
69+ Copy-Item beaengine/src/COPYING.LESSER.txt Release/net48/LICENSES/LICENSE.BeaEngine.LGPL.txt
70+
71+ # Win64 for .NET 8+
72+ cmake -S beaengine -B build-beaengine-64 `
73+ -A x64 `
74+ -DoptBUILD_DLL=ON `
75+ -DoptHAS_OPTIMIZED=ON `
76+ -DoptHAS_SYMBOLS=OFF `
77+ -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
78+
79+ cmake --build build-beaengine-64 --config Release
80+
81+ $dll64 = Get-ChildItem -Recurse build-beaengine-64 -Filter BeaEngine*.dll | Select-Object -First 1
82+
83+ if (-not $dll64) {
84+ throw "64-bit BeaEngine.dll not found"
85+ }
86+
87+ Copy-Item $dll64.FullName publish-$env:DOTNET_RUNTIME/BeaEngine.dll
88+ Copy-Item beaengine/src/COPYING.txt publish-$env:DOTNET_RUNTIME/LICENSES/LICENSE.BeaEngine.GPL.txt
89+ Copy-Item beaengine/src/COPYING.LESSER.txt publish-$env:DOTNET_RUNTIME/LICENSES/LICENSE.BeaEngine.LGPL.txt
3290
3391 - uses : actions/upload-artifact@v4
34- if : github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
3592 with :
3693 name : de4dotEx-net48
3794 path : Release/net48
3895
3996 - uses : actions/upload-artifact@v4
40- if : github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
4197 with :
42- name : de4dotEx-net8.0 -win-x64
43- path : publish-net8.0
98+ name : de4dotEx-${{ env.DOTNET_RUNTIME }} -win-x64
99+ path : publish-${{ env.DOTNET_RUNTIME }}
44100
45101 build-linux :
46102 name : Build Linux artifacts & package .deb
@@ -52,19 +108,38 @@ jobs:
52108 - name : Set up .NET
53109 uses : actions/setup-dotnet@v4
54110 with :
55- dotnet-version : 8.0.x
111+ dotnet-version : ${{ env.SETUP_DOTNET_VERSION }}
112+
113+ - name : Publish ${{ env.DOTNET_RUNTIME }}
114+ run : |
115+ dotnet publish -c Release -f "${DOTNET_RUNTIME}" -o publish-${DOTNET_RUNTIME} de4dot
116+ rm -rf publish-${DOTNET_RUNTIME}/*.pdb publish-${DOTNET_RUNTIME}/*.xml
56117
57- - name : Publish net8.0
118+ - name : Build BeaEngine
58119 run : |
59- dotnet publish -c Release -f net8.0 -o publish-net8.0 de4dot
60- rm -rf publish-net8.0/*.pdb publish-net8.0/*.xml
120+ set -euo pipefail
121+
122+ git clone --depth 1 --branch "$BEAENGINE_TAG" https://github.com/BeaEngine/beaengine.git
123+
124+ cmake -S beaengine -B build64 \
125+ -DoptBUILD_DLL=ON \
126+ -DoptHAS_OPTIMIZED=ON \
127+ -DoptHAS_SYMBOLS=OFF
128+
129+ cmake --build build64
130+
131+ so64=$(find build64 -name "libBeaEngine*.so" | head -n 1)
132+ [[ -n "$so64" ]] || { echo "libBeaEngine not found"; exit 1; }
133+
134+ cp "$so64" publish-${DOTNET_RUNTIME}/libBeaEngine.so
135+ cp beaengine/src/COPYING.txt publish-${DOTNET_RUNTIME}/LICENSES/LICENSE.BeaEngine.GPL.txt
136+ cp beaengine/src/COPYING.LESSER.txt publish-${DOTNET_RUNTIME}/LICENSES/LICENSE.BeaEngine.LGPL.txt
61137
62138 - name : Upload publish folder
63- if : github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
64139 uses : actions/upload-artifact@v4
65140 with :
66- name : de4dotEx-net8.0 -linux-x64
67- path : publish-net8.0
141+ name : de4dotEx-${{ env.DOTNET_RUNTIME }} -linux-x64
142+ path : publish-${{ env.DOTNET_RUNTIME }}
68143
69144 - name : Extract version from Git tag
70145 if : startsWith(github.ref, 'refs/tags/')
77152 if : startsWith(github.ref, 'refs/tags/')
78153 run : |
79154 mkdir -p deb-root/opt/de4dotEx
80- cp -r publish-net8.0/* deb-root/opt/de4dotEx/
155+ cp -r " publish-$DOTNET_RUNTIME/*" deb-root/opt/de4dotEx/
81156
82157 mkdir -p deb-root/usr/local/bin
83158 ln -s /opt/de4dotEx/de4dot deb-root/usr/local/bin/de4dot
90165 Priority: optional
91166 Architecture: amd64
92167 Maintainer: G DATA Advanced Analytics GmbH <mwa@gdata-adan.de>
93- Depends: libicu77 | libicu76 | libicu74 | libicu72 | libicu70 | libicu67 | libicu66
168+ Depends: libicu78 | libicu77 | libicu76 | libicu74 | libicu72 | libicu70 | libicu67 | libicu66
94169 Description: .NET deobfuscator and unpacker
95170 de4dot is a .NET deobfuscator and unpacker. It will try its best to
96171 restore a packed and obfuscated assembly to almost the original
@@ -106,5 +181,5 @@ jobs:
106181 - uses : actions/upload-artifact@v4
107182 if : startsWith(github.ref, 'refs/tags/')
108183 with :
109- name : de4dotEx-${{ steps.get_version.outputs.VERSION }}-net8.0 -x64-deb
184+ name : de4dotEx-${{ steps.get_version.outputs.VERSION }}-${{ env.DOTNET_RUNTIME }} -x64-deb
110185 path : de4dotEx-${{ steps.get_version.outputs.VERSION }}.deb
0 commit comments