Skip to content

feat: retarget ConfuserEx from .NET Framework 4.6.1 to .NET 10 #134

feat: retarget ConfuserEx from .NET Framework 4.6.1 to .NET 10

feat: retarget ConfuserEx from .NET Framework 4.6.1 to .NET 10 #134

Workflow file for this run

name: ci
on:
push:
branches: [master, pre-release, feature/**, fix/**]
pull_request:
branches: [master, pre-release]
jobs:
build:
runs-on: windows-2025
timeout-minutes: 10
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.vcxproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Install nbgv
run: dotnet tool install -g nbgv
- name: Compute version
id: version
shell: pwsh
run: |
$ver = nbgv get-version -v NuGetPackageVersion
echo "VERSION=$ver" >> $env:GITHUB_OUTPUT
Write-Host "Version: $ver"
- name: Restore
run: msbuild Confuser2.sln -t:Restore -verbosity:minimal
- name: Build
run: msbuild Confuser2.sln -p:Configuration=Release -verbosity:minimal
- name: Package CLI
shell: pwsh
run: |
$src = 'Confuser.CLI/bin/Release/net10.0'
$zip = 'ConfuserEx-CLI.zip'
Get-ChildItem $src -Exclude '*.pdb','*.xml' | Compress-Archive -DestinationPath $zip
Write-Host "Created $zip ($([math]::Round((Get-Item $zip).Length / 1MB, 1)) MB)"
- name: Package GUI
shell: pwsh
run: |
$src = 'ConfuserEx/bin/Release/net10.0-windows'
$zip = 'ConfuserEx-GUI.zip'
Get-ChildItem $src -Exclude '*.pdb','*.xml' | Compress-Archive -DestinationPath $zip
Write-Host "Created $zip ($([math]::Round((Get-Item $zip).Length / 1MB, 1)) MB)"
- name: Package combined
shell: pwsh
run: |
$zip = 'ConfuserEx.zip'
$tmp = 'combined'
New-Item -ItemType Directory -Path $tmp -Force | Out-Null
Copy-Item 'Confuser.CLI/bin/Release/net10.0/*' $tmp -Exclude '*.pdb','*.xml' -Recurse
Copy-Item 'ConfuserEx/bin/Release/net10.0-windows/*' $tmp -Exclude '*.pdb','*.xml' -Recurse -Force
Get-ChildItem $tmp | Compress-Archive -DestinationPath $zip
Remove-Item $tmp -Recurse -Force
Write-Host "Created $zip ($([math]::Round((Get-Item $zip).Length / 1MB, 1)) MB)"
- name: Upload artifacts
uses: actions/upload-artifact@v5
with:
name: confuserex-packages
path: |
ConfuserEx-CLI.zip
ConfuserEx-GUI.zip
ConfuserEx.zip
Confuser.MSBuild.Tasks/bin/Release/*.nupkg
# Pre-release: on push to pre-release branch
pre-release:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/pre-release'
runs-on: windows-2025
timeout-minutes: 5
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install nbgv
run: dotnet tool install -g nbgv
- name: Compute version
id: version
shell: pwsh
run: |
$ver = nbgv get-version -v NuGetPackageVersion
echo "VERSION=$ver" >> $env:GITHUB_OUTPUT
Write-Host "Pre-release version: $ver"
- name: Download artifacts
uses: actions/download-artifact@v5
with:
name: confuserex-packages
- name: Create or update pre-release
uses: softprops/action-gh-release@v2
with:
tag_name: pre-release
name: "Pre-release v${{ steps.version.outputs.VERSION }}"
prerelease: true
make_latest: false
body: |
**Pre-release build** — for testing only, not production use.
Version: `${{ steps.version.outputs.VERSION }}`
Branch: `pre-release`
Commit: ${{ github.sha }}
Download the binaries below to test recent fixes and features before they are included in a stable release.
files: |
ConfuserEx-CLI.zip
ConfuserEx-GUI.zip
ConfuserEx.zip
*.nupkg
# Release: only on PR merge to master
release:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: windows-2025
timeout-minutes: 5
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install nbgv
run: dotnet tool install -g nbgv
- name: Compute version
id: version
shell: pwsh
run: |
$ver = nbgv get-version -v NuGetPackageVersion
echo "VERSION=$ver" >> $env:GITHUB_OUTPUT
Write-Host "Version: $ver"
- name: Configure git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Create release tag
run: |
git tag -a "v${{ steps.version.outputs.VERSION }}" -m "Release ${{ steps.version.outputs.VERSION }}"
git push origin "v${{ steps.version.outputs.VERSION }}"
- name: Download artifacts
uses: actions/download-artifact@v5
with:
name: confuserex-packages
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.VERSION }}
name: v${{ steps.version.outputs.VERSION }}
files: |
ConfuserEx-CLI.zip
ConfuserEx-GUI.zip
ConfuserEx.zip
*.nupkg