Fix release #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Release | |
| on: | |
| push: | |
| branches: [ "main", "master" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Magic in Form1.cs.. #Yes very obfuscating you will never know whats happening here lol | |
| env: | |
| OIFHASO: ${{ secrets.RMU9283DURM9UF }} | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| shell: pwsh | |
| run: | | |
| $path = "r6random/Form1.cs" | |
| $content = Get-Content -Path $path -Raw | |
| if ($content -notmatch "ftm04857ht08745htjf") { | |
| Write-Error "CRITICAL ERROR: Could not find 'ftm04857ht08745htjf' in Form1.cs! Did you push the placeholder to GitHub?" | |
| exit 1 | |
| } | |
| $content = $content.Replace("ftm04857ht08745htjf", $env:OIFHASO) | |
| Set-Content -Path $path -Value $content -Encoding UTF8 | |
| $check = Get-Content -Path $path -Raw | |
| if ($check -match "ftm04857ht08745htjf") { | |
| Write-Error "CRITICAL ERROR: Replacement failed to save!" | |
| exit 1 | |
| } | |
| Write-Host "Success: Magic!" | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v1.1 | |
| - name: Restore NuGet Packages | |
| run: nuget restore r6random.sln | |
| - name: Build the App | |
| run: msbuild r6random.sln /p:Configuration=Release | |
| - name: Install Obfuscar | |
| run: dotnet tool install --global Obfuscar.GlobalTool | |
| - name: Create Obfuscar Config | |
| shell: pwsh | |
| run: | | |
| # Target the exact 4.7.2 Reference Assembly folder | |
| $netFrameworkPath = "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2" | |
| # Verify the path exists | |
| if (-not (Test-Path "$netFrameworkPath\System.Windows.Forms.dll")) { | |
| Write-Error "Could not find System.Windows.Forms.dll at $netFrameworkPath" | |
| exit 1 | |
| } | |
| $xml = @" | |
| <?xml version='1.0'?> | |
| <Obfuscator> | |
| <Var name='InPath' value='r6random\bin\Release' /> | |
| <Var name='OutPath' value='r6random\bin\Release\Obfuscated' /> | |
| <Var name='CopyDependencies' value='true' /> | |
| <AssemblySearchPath path='$netFrameworkPath' /> | |
| <AssemblySearchPath path='r6random\bin\Release' /> | |
| <Var name='KeepPublicApi' value='true' /> | |
| <Var name='HidePrivateApi' value='true' /> | |
| <Var name='HideStrings' value='true' /> | |
| <Var name='OptimizeMethods' value='true' /> | |
| <Var name='SuppressIldasm' value='true' /> | |
| <Module file='`$(InPath)\r6random.exe'> | |
| <SkipType name="r6random.Form1" /> | |
| <SkipType name="r6random.Form2" /> | |
| <SkipType name="r6random.OperatorInfo" /> | |
| <SkipType name="r6random.Weapon" /> | |
| <SkipType name="r6random.Gadget" /> | |
| </Module> | |
| </Obfuscator> | |
| "@ | |
| Set-Content -Path obfuscar.xml -Value $xml -Encoding UTF8 | |
| Write-Host "Success: Pointed Obfuscar to .NET 4.7.2 Reference Assemblies." | |
| - name: Run Obfuscation | |
| run: obfuscar.console obfuscar.xml | |
| # ----------------------------- | |
| - name: Cleanup and Flatten Folders | |
| shell: pwsh | |
| run: | | |
| Move-Item -Path "r6random/bin/Release/Obfuscated/r6random.exe" -Destination "r6random/bin/Release/r6random.exe" -Force | |
| Remove-Item -Path "r6random/bin/Release/Obfuscated" -Recurse -Force | |
| Write-Host "Success: Folder flattened!" | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: R6Random-Release | |
| path: | | |
| r6random/bin/Release/ | |
| !r6random/bin/Release/**/*.pdb | |
| !r6random/bin/Release/**/*.xml | |
| !r6random/bin/Release/Mapping.txt | |
| !r6random/bin/Release/obfuscar.xml | |
| !r6random/bin/Release/Obfuscated/ |