|
1 | | -name: CI build |
| 1 | +name: CI Build |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: [ "master" ] |
| 6 | + tags: [ "*" ] |
6 | 7 | pull_request: |
7 | 8 | branches: [ "master" ] |
8 | 9 | workflow_dispatch: |
9 | 10 |
|
10 | 11 | jobs: |
11 | | - build: |
12 | | - name: Build |
| 12 | + build-windows: |
| 13 | + name: Build Windows artifacts |
13 | 14 | runs-on: windows-latest |
14 | 15 |
|
15 | 16 | steps: |
16 | | - - uses: actions/checkout@v1 |
| 17 | + - uses: actions/checkout@v4 |
17 | 18 |
|
18 | 19 | - name: Build |
19 | 20 | shell: pwsh |
20 | 21 | run: | |
21 | 22 | $msbuildPath = Split-Path (& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\Current\Bin\amd64\MSBuild.exe | Select-Object -First 1) -Parent |
22 | | - $env:PATH = $msbuildPath + ';' + $env:PATH |
23 | | - .\build.ps1 |
| 23 | + $env:PATH = "$msbuildPath;$env:PATH" |
| 24 | +
|
| 25 | + dotnet build -c Release -f net48 de4dot.netframework.sln |
| 26 | + Remove-Item Release\net48\*.pdb, Release\net48\*.xml, Release\net48\Test.Rename.* |
| 27 | +
|
| 28 | + dotnet publish -c Release -f net8.0 -o publish-net8.0 de4dot |
| 29 | + Remove-Item publish-net8.0\*.pdb, publish-net8.0\*.xml |
24 | 30 |
|
25 | 31 | - uses: actions/upload-artifact@v4 |
26 | 32 | if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') |
27 | 33 | with: |
28 | | - name: de4dot-net48 |
| 34 | + name: de4dotEx-net48 |
29 | 35 | path: Release/net48 |
30 | 36 |
|
31 | 37 | - uses: actions/upload-artifact@v4 |
32 | 38 | if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') |
33 | 39 | with: |
34 | | - name: de4dot-net8.0 |
| 40 | + name: de4dotEx-net8.0-win-x64 |
35 | 41 | path: publish-net8.0 |
| 42 | + |
| 43 | + build-linux: |
| 44 | + name: Build Linux artifacts & package .deb |
| 45 | + runs-on: ubuntu-latest |
| 46 | + |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v4 |
| 49 | + |
| 50 | + - name: Set up .NET |
| 51 | + uses: actions/setup-dotnet@v4 |
| 52 | + with: |
| 53 | + dotnet-version: 8.0.x |
| 54 | + |
| 55 | + - name: Publish net8.0 |
| 56 | + run: | |
| 57 | + dotnet publish -c Release -f net8.0 -o publish-net8.0 de4dot |
| 58 | + rm -rf publish-net8.0/*.pdb publish-net8.0/*.xml |
| 59 | +
|
| 60 | + - name: Upload publish folder |
| 61 | + if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') |
| 62 | + uses: actions/upload-artifact@v4 |
| 63 | + with: |
| 64 | + name: de4dotEx-net8.0-linux-x64 |
| 65 | + path: publish-net8.0 |
| 66 | + |
| 67 | + - name: Extract version from Git tag |
| 68 | + if: startsWith(github.ref, 'refs/tags/') |
| 69 | + id: get_version |
| 70 | + run: | |
| 71 | + VERSION="${GITHUB_REF#refs/tags/}" |
| 72 | + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT |
| 73 | +
|
| 74 | + - name: Create .deb package |
| 75 | + if: startsWith(github.ref, 'refs/tags/') |
| 76 | + run: | |
| 77 | + mkdir -p deb-root/opt/de4dotEx |
| 78 | + cp -r publish-net8.0/* deb-root/opt/de4dotEx/ |
| 79 | +
|
| 80 | + mkdir -p deb-root/usr/local/bin |
| 81 | + ln -s /opt/de4dotEx/de4dot deb-root/usr/local/bin/de4dot |
| 82 | +
|
| 83 | + mkdir -p deb-root/DEBIAN |
| 84 | + cat <<EOF > deb-root/DEBIAN/control |
| 85 | + Package: de4dotEx |
| 86 | + Version: ${{ steps.get_version.outputs.VERSION }} |
| 87 | + Section: utils |
| 88 | + Priority: optional |
| 89 | + Architecture: amd64 |
| 90 | + Maintainer: G DATA Advanced Analytics GmbH <mwa@gdata-adan.de> |
| 91 | + Depends: libicu77 | libicu76 | libicu74 | libicu72 | libicu70 | libicu67 | libicu66 |
| 92 | + Description: .NET deobfuscator and unpacker |
| 93 | + de4dot is a .NET deobfuscator and unpacker. It will try its best to |
| 94 | + restore a packed and obfuscated assembly to almost the original |
| 95 | + assembly. |
| 96 | + . |
| 97 | + Most of the obfuscation can be completely restored (e.g., string |
| 98 | + encryption), but symbol renaming is impossible to restore since the |
| 99 | + original names aren't (usually) part of the obfuscated assembly. |
| 100 | + EOF |
| 101 | +
|
| 102 | + dpkg-deb --build deb-root de4dotEx-${{ steps.get_version.outputs.VERSION }}.deb |
| 103 | +
|
| 104 | + - uses: actions/upload-artifact@v4 |
| 105 | + if: startsWith(github.ref, 'refs/tags/') |
| 106 | + with: |
| 107 | + name: de4dotEx-${{ steps.get_version.outputs.VERSION }}-net8.0-x64-deb |
| 108 | + path: de4dotEx-${{ steps.get_version.outputs.VERSION }}.deb |
0 commit comments