Skip to content

Commit

Permalink
Merge pull request #25 from 3shape/features/new-build-process
Browse files Browse the repository at this point in the history
Added a new build process
  • Loading branch information
marcgiannandrea3s authored Aug 28, 2024
2 parents 06adef9 + 67f261a commit 5f443d9
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 17 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-nuget-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build & Test Obfuscar

on:
pull_request:
branches:
- master
- ThreeShape.Obfuscar
- 3shape

env:
ProjectFolder: 'Obfuscar'
SolutionFile: 'Obfuscar.sln'
NugetPackOutputDir: 'nuget-pack-out'
configuration: 'Release'

jobs:
build-project:
runs-on: windows-2022
timeout-minutes: 10
steps:
- name: Dotnet info
run: dotnet --info

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'

- name: Setup NuGet.exe
uses: nuget/setup-nuget@v2

- name: Nuget restore project
shell: pwsh
run: |
nuget restore ${{ env.SolutionFile }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Build project
shell: pwsh
run: |
msbuild ${{ env.SolutionFile }} -p:Configuration=${{ env.configuration }} `
-m:1 `
-nr:false
- name: Run unit tests
shell: pwsh
run: |
$testFiles = Get-ChildItem -Path . -Filter "*test.dll" -Recurse | ForEach-Object { $_.FullName }
foreach ($testFile in $testFiles) {
dotnet test $testFile --logger trx
}
- name: Publish test results
uses: phoenix-actions/test-reporting@v15
with:
name: 'VsTest report results'
path: '**/*.trx'
reporter: 'dotnet-trx'
output-to: 'step-summary'
11 changes: 0 additions & 11 deletions Console/Obfuscar.Console.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<!-- Import and sign obfuscar console executable if not running local: JENKINS_URL is set on build agent -->
<PropertyGroup>
<TrueValue>true</TrueValue>
<IsLocalRun Condition="'$(JENKINS_URL)' == ''">$(TrueValue)</IsLocalRun>
</PropertyGroup>
<Import Project="$(SolutionDir)\BuildTools\ThreeShape.MSBuild.ObfuscateAndSign\build\ThreeShape.MSBuild.ObfuscateAndSign.targets" Condition="'$(IsLocalRun)' != '$(TrueValue)'" />
<Target Name="SignObfuscarConsoleExecutableAssembly" AfterTargets="RepackWithILOnWindows;RepackWithILOnNonWindows" Condition="'$(IsLocalRun)' != '$(TrueValue)'">
<Message Text="Signing Obfuscar console executable assembly" Importance="high" />
<SignFile FileToSign="$(TargetDir)\Obfuscar.Console.exe" SigningCompany="3Shape" />
</Target>

<Target Name="RepackWithILOnWindows" AfterTargets="Build" Condition="'$(Configuration)' == 'Release' AND '$(OS)' == 'Windows_NT'">
<Exec Command="rename Obfuscar.Console.exe Obfuscar.exe" WorkingDirectory="$(TargetDir)" />
<Exec Command="&quot;$(ILRepack)&quot; /t:exe /out:Obfuscar.Console.exe Obfuscar.exe Baml.dll Mono.Cecil.dll Mono.Cecil.Pdb.dll Mono.Cecil.Rocks.dll Mono.Options.dll Obfuscar.dll Rollbar.dll Newtonsoft.Json.dll" WorkingDirectory="$(TargetDir)" />
Expand Down
1 change: 1 addition & 0 deletions Obfuscar/Obfuscar.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net60-windows;net48</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions packages.config

This file was deleted.

4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ If you want to donate to my efforts on this project, please use the following li

/Master - Not to be changed in 3Shape - should be kept in sync with the fork origin.


Build link: https://jenkins.3shape.local/job/obfuscar/
Build Link: https://github.com/3shape/obfuscar/actions
Release link: https://github.com/3ShapeInternal/ThreeShape.Obfuscar.Release

0 comments on commit 5f443d9

Please sign in to comment.