Skip to content

Commit 4b81716

Browse files
committed
Revamp actions workflow to build multiple platforms
1 parent 11dde90 commit 4b81716

1 file changed

Lines changed: 81 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,108 @@
1-
name: CI build
1+
name: CI Build
22

33
on:
44
push:
55
branches: [ "master" ]
6+
tags: [ "*" ]
67
pull_request:
78
branches: [ "master" ]
89
workflow_dispatch:
910

1011
jobs:
11-
build:
12-
name: Build
12+
build-windows:
13+
name: Build Windows artifacts
1314
runs-on: windows-latest
1415

1516
steps:
16-
- uses: actions/checkout@v1
17+
- uses: actions/checkout@v4
1718

1819
- name: Build
1920
shell: pwsh
2021
run: |
2122
$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
2430
2531
- uses: actions/upload-artifact@v4
2632
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
2733
with:
28-
name: de4dot-net48
34+
name: de4dotEx-net48
2935
path: Release/net48
3036

3137
- uses: actions/upload-artifact@v4
3238
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
3339
with:
34-
name: de4dot-net8.0
40+
name: de4dotEx-net8.0-win-x64
3541
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

Comments
 (0)