Skip to content

Commit

Permalink
Merge pull request #214 from gerardog/Feature.Arm64Build
Browse files Browse the repository at this point in the history
Feat: Add net70-arm64 build, remove net46
  • Loading branch information
gerardog authored Nov 30, 2022
2 parents e376109 + d6ba33c commit a221cc7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
22 changes: 9 additions & 13 deletions build/01-build.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
pushd $PSScriptRoot\..
dotnet publish .\src\gsudo\gsudo.csproj -c Release -o .\artifacts\net46-AnyCpu\unmerged -f net46 -p:Platform=AnyCpu -v minimal -p:WarningLevel=0 || $(exit $LASTEXITCODE)
#dotnet publish .\src\gsudo\gsudo.csproj -c Release -o .\artifacts\net70-arm64 -f net7.0 -r win-arm64 --sc -p:PublishReadyToRun=true -p:PublishSingleFile=true -v minimal -p:WarningLevel=0 || $(exit $LASTEXITCODE)
"-- Cleaning bin & obj folders"
Get-Item ".\src\gsudo\bin\", ".\src\gsudo\obj\" -ErrorAction Ignore | Remove-Item -Recurse -Force
"-- Building net7.0 win-arm64"
dotnet publish .\src\gsudo\gsudo.csproj -c Release -o .\artifacts\arm64 -f net7.0 -r win-arm64 --sc -p:PublishAot=true -p:IlcOptimizationPreference=Size -v minimal -p:WarningLevel=0 || $(exit $LASTEXITCODE)
"-- Building net7.0 win-x64"
dotnet publish .\src\gsudo\gsudo.csproj -c Release -o .\artifacts\x64 -f net7.0 -r win-x64 --sc -p:PublishAot=true -p:IlcOptimizationPreference=Size -v minimal -p:WarningLevel=0 || $(exit $LASTEXITCODE)
"-- Building net7.0 win-x86"
dotnet publish .\src\gsudo\gsudo.csproj -c Release -o .\artifacts\x86 -f net7.0 -r win-x86 --sc -p:PublishReadyToRun=true -p:PublishSingleFile=true -v minimal -p:WarningLevel=0 || $(exit $LASTEXITCODE)
dotnet publish .\src\gsudo\gsudo.csproj -c Release -o .\artifacts\x64 -f net7.0 -r win-x64 --sc -p:PublishAot=true -p:IlcOptimizationPreference=Size || $(exit $LASTEXITCODE)

ilmerge .\artifacts\net46-AnyCpu\unmerged\gsudo.exe .\artifacts\net46-AnyCpu\unmerged\*.dll /out:.\artifacts\net46-AnyCpu\gsudo.exe /target:exe /targetplatform:v4,"C:\Windows\Microsoft.NET\Framework\v4.0.30319" /ndebug /wildcards || $(exit $LASTEXITCODE)

if ($?) {
rm artifacts\net46-AnyCpu\unmerged -Recurse
echo "ilmerge -> artifacts\net46-AnyCpu\"
}

cp .\src\gsudo.Wrappers\* .\artifacts\net46-AnyCpu
#cp .\src\gsudo.Wrappers\* .\artifacts\net70-arm64
cp .\src\gsudo.Wrappers\* .\artifacts\x86
cp .\src\gsudo.Wrappers\* .\artifacts\x64
cp .\src\gsudo.Wrappers\* .\artifacts\x64
cp .\src\gsudo.Wrappers\* .\artifacts\arm64

popd
6 changes: 2 additions & 4 deletions build/03-sign.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ $files = @(
"artifacts\x64\*.p*1"
"artifacts\x86\*.exe",
"artifacts\x86\*.p*1",
#"artifacts\arm64\*.exe",
#"artifacts\arm64\*.p*1",
"artifacts\net46-AnyCpu\*.exe",
"artifacts\net46-AnyCpu\*.p*1"
"artifacts\arm64\*.exe",
"artifacts\arm64\*.p*1"
) -join " "

# Accept $args override.
Expand Down
2 changes: 1 addition & 1 deletion build/04-release-GitHub.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if ($env:version) {
Get-ChildItem .\artifacts\ -File | Remove-Item # Remove files on artifacts root
Get-ChildItem .\artifacts\ -Filter *.pdb -Recurse | Remove-Item # Remove *.pdb on subfolders

Compress-Archive -Path ./artifacts/x86,./artifacts/x64,./artifacts/net46-AnyCpu -DestinationPath "artifacts/gsudo.v$($version).zip" -force -CompressionLevel Optimal
Compress-Archive -Path ./artifacts/x86,./artifacts/x64,./artifacts/arm64 -DestinationPath "artifacts/gsudo.v$($version).zip" -force -CompressionLevel Optimal
(Get-FileHash artifacts\gsudo.v$($version).zip).hash > artifacts\gsudo.v$($version).zip.sha256

$msbuild = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
Expand Down
12 changes: 10 additions & 2 deletions src/gsudo.Installer/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<ComponentRef Id="GSudoPath" />
<ComponentRef Id="GSudoExe" />
<ComponentRef Id="GSudoExeX86" />
<ComponentRef Id="GSudoExeARM64" />
<ComponentRef Id="GSudoBash" />
<ComponentRef Id="GSudoPowerShell" />
</ComponentGroup>
Expand All @@ -67,11 +68,18 @@

<Component Id="GSudoExe" Guid="bec137e1-06e2-4efb-aea9-30306cc01c87">
<Condition>
<![CDATA[VersionNT64]]>
<![CDATA[(VersionNT64) AND NOT(%PROCESSOR_ARCHITECTURE~="ARM64")]]>
</Condition>
<File Id="GSudoExe" KeyPath="yes" Name="gsudo.exe" Source="..\..\artifacts\x64\gsudo.exe"/>
</Component>


<Component Id="GSudoExeARM64" Guid="bec137e1-06e2-4efb-aea9-30306cc01c85">
<Condition>
<![CDATA[(VersionNT64) AND (%PROCESSOR_ARCHITECTURE~="ARM64")]]>
</Condition>
<File Id="GSudoExeARM64" KeyPath="yes" Name="gsudo.exe" Source="..\..\artifacts\arm64\gsudo.exe"/>
</Component>

<Component Id="GSudoExeX86" Guid="bec137e1-06e2-4efb-aea9-30306cc01c86">
<Condition>
<![CDATA[NOT(VersionNT64)]]>
Expand Down

0 comments on commit a221cc7

Please sign in to comment.