Skip to content

Free, open-source Windows optimization tool for performance, privacy, and simplicity.

feat: support ARM64 publish alongside x64

fatDucke1d9b9c30e74
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1224569..5ab9175 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -44,7 +44,8 @@ jobs:
- name: Publish Single
run: |
- dotnet publish optimizerDuck/optimizerDuck.csproj --nologo /p:PublishProfile=Single
+ dotnet publish optimizerDuck/optimizerDuck.csproj -c Release -r win-x64 --nologo /p:PublishProfile=Single
+ dotnet publish optimizerDuck/optimizerDuck.csproj -c Release -r win-arm64 --nologo /p:PublishProfile=Single
shell: pwsh
- name: Resolve release tag
@@ -67,19 +68,20 @@ jobs:
echo "version=$version" >> $env:GITHUB_OUTPUT
Write-Host "Attaching assets to release $tag (version $version)"
- - name: Rename output file
+ - name: Rename output files
run: |
$version = "${{ steps.get_version.outputs.version }}"
- $source = "optimizerDuck/bin/Release/Single/net10.0/publish/win-x64/optimizerDuck.exe"
- $dest = "optimizerDuck-Windows-x64-$version.exe"
- Move-Item -Path $source -Destination $dest
+ Move-Item -Path "optimizerDuck/bin/Release/Single/net10.0/publish/win-x64/optimizerDuck.exe" -Destination "optimizerDuck-Windows-x64-$version.exe"
+ Move-Item -Path "optimizerDuck/bin/Release/Single/net10.0/publish/win-arm64/optimizerDuck.exe" -Destination "optimizerDuck-Windows-arm64-$version.exe"
shell: pwsh
- name: Upload Release Asset
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.get_version.outputs.tag }}
- files: ./optimizerDuck-Windows-x64-${{ steps.get_version.outputs.version }}.exe
+ files: |
+ ./optimizerDuck-Windows-x64-${{ steps.get_version.outputs.version }}.exe
+ ./optimizerDuck-Windows-arm64-${{ steps.get_version.outputs.version }}.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -92,7 +94,10 @@ jobs:
$tag = "${{ steps.get_version.outputs.tag }}"
$owner = "${{ github.repository_owner }}"
$repo = "optimizerDuck"
- $targetAsset = "optimizerDuck-Windows-x64-${{ steps.get_version.outputs.version }}.exe"
+ $targetAssets = @(
+ "optimizerDuck-Windows-x64-${{ steps.get_version.outputs.version }}.exe",
+ "optimizerDuck-Windows-arm64-${{ steps.get_version.outputs.version }}.exe"
+ )
$maxRetries = 60
$retryDelay = 2
@@ -105,12 +110,13 @@ jobs:
"Accept" = "application/vnd.github+json"
}
- $asset = $response.assets | Where-Object {
- $_.name -eq $targetAsset -and $_.name -like "*.exe"
- }
+ $missing = @($targetAssets | Where-Object {
+ $name = $_
+ -not ($response.assets | Where-Object { $_.name -eq $name })
+ })
- if ($asset) {
- Write-Host "::notice::Asset '$targetAsset' found and ready!"
+ if ($missing.Count -eq 0) {
+ Write-Host "::notice::Assets '$($targetAssets -join ', ')' found and ready!"
echo "verified=true" >> $env:GITHUB_OUTPUT
exit 0
}
diff --git a/README.md b/README.md
index c167006..af98dd4 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@
<br>
[![CI](https://github.com/itsfatduck/optimizerDuck/actions/workflows/ci.yml/badge.svg)](https://github.com/itsfatduck/optimizerDuck/actions/workflows/ci.yml)
[![.NET Latest](https://img.shields.io/badge/.NET_Runtime-Latest-ef99dd?style=flat-square)](https://dotnet.microsoft.com/en-us/download)
-[![Supported OS](https://img.shields.io/badge/Supported-Windows_10%2B_x64-0078d4?style=flat-square)](https://www.microsoft.com/en-us/software-download/)
+[![Supported OS](https://img.shields.io/badge/Supported-Windows_10%2B_x64_%7C_ARM64-0078d4?style=flat-square)](https://www.microsoft.com/en-us/software-download/)
<br>
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/itsfatduck)
@@ -235,7 +235,7 @@ Yes. Every optimization creates a revert file before applying. You can undo indi
### Does this work on Windows 10 and Windows 11?
-Yes. optimizerDuck supports **Windows 10 (x64)** and **Windows 11 (x64)**.
+Yes. optimizerDuck supports **Windows 10/11 (x64 & ARM64)**.
### Do I need administrator rights?
diff --git a/optimizerDuck/Properties/PublishProfiles/Portable.pubxml b/optimizerDuck/Properties/PublishProfiles/Portable.pubxml
index 89684a2..cdf19b8 100644
--- a/optimizerDuck/Properties/PublishProfiles/Portable.pubxml
+++ b/optimizerDuck/Properties/PublishProfiles/Portable.pubxml
@@ -3,11 +3,11 @@
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
- <Platform>x64</Platform>
+ <Platform Condition="'$(Platform)'==''">x64</Platform>
- <RuntimeIdentifier>win-x64</RuntimeIdentifier>
+ <RuntimeIdentifier Condition="'$(RuntimeIdentifier)'==''">win-x64</RuntimeIdentifier>
- <PublishDir>bin\Release\Portable\net10.0\publish\win-x64\</PublishDir>
+ <PublishDir>bin\Release\Portable\net10.0\publish\$(RuntimeIdentifier)\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
diff --git a/optimizerDuck/Properties/PublishProfiles/Single.pubxml b/optimizerDuck/Properties/PublishProfiles/Single.pubxml
index 1ae369c..ad95b7d 100644
--- a/optimizerDuck/Properties/PublishProfiles/Single.pubxml
+++ b/optimizerDuck/Properties/PublishProfiles/Single.pubxml
@@ -3,11 +3,11 @@
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
- <Platform>x64</Platform>
+ <Platform Condition="'$(Platform)'==''">x64</Platform>
- <RuntimeIdentifier>win-x64</RuntimeIdentifier>
+ <RuntimeIdentifier Condition="'$(RuntimeIdentifier)'==''">win-x64</RuntimeIdentifier>
- <PublishDir>bin\Release\Single\net10.0\publish\win-x64\</PublishDir>
+ <PublishDir>bin\Release\Single\net10.0\publish\$(RuntimeIdentifier)\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
diff --git a/optimizerDuck/optimizerDuck.csproj b/optimizerDuck/optimizerDuck.csproj
index dc4962d..00d0e9b 100644
--- a/optimizerDuck/optimizerDuck.csproj
+++ b/optimizerDuck/optimizerDuck.csproj
@@ -29,10 +29,6 @@
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
- <PlatformTarget>x64</PlatformTarget>
- </PropertyGroup>
-
<ItemGroup>
<Page Update="UI\Windows\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
diff --git a/publish.bat b/publish.bat
index 1ea7875..31d798b 100644
--- a/publish.bat
+++ b/publish.bat
@@ -6,6 +6,7 @@ set "PROJECT_PATH=%SCRIPT_DIR%optimizerDuck\optimizerDuck.csproj"
set "TEST_PROJECT=%SCRIPT_DIR%optimizerDuck.Test\optimizerDuck.Test.csproj"
set "CONFIGURATION=Release"
set "PROFILE="
+set "ARCH=x64"
set "RUN_TESTS=1"
set "PAUSE_ON_EXIT=1"
@@ -32,6 +33,7 @@ echo ========================================
echo optimizerDuck publish
echo ========================================
echo Profile: %PROFILE%
+echo Arch: %ARCH%
echo Configuration: %CONFIGURATION%
if "%RUN_TESTS%"=="1" (
echo Run tests: Yes
@@ -55,7 +57,7 @@ if "%RUN_TESTS%"=="1" (
echo.
echo [2/2] Publishing %PROFILE% profile...
-dotnet publish "%PROJECT_PATH%" -c %CONFIGURATION% --nologo /p:PublishProfile=%PROFILE%
+dotnet publish "%PROJECT_PATH%" -c %CONFIGURATION% -r win-%ARCH% --nologo /p:PublishProfile=%PROFILE%
if errorlevel 1 (
echo.
echo Publish failed.
@@ -93,6 +95,24 @@ if /I "%~1"=="--single" (
goto :parse_args
)
+if /I "%~1"=="x64" (
+ set "ARCH=x64"
+ shift
+ goto :parse_args
+)
+
+if /I "%~1"=="arm64" (
+ set "ARCH=arm64"
+ shift
+ goto :parse_args
+)
+
+if /I "%~1"=="x86" (
+ set "ARCH=x86"
+ shift
+ goto :parse_args
+)
+
if /I "%~1"=="--skip-tests" (
set "RUN_TESTS=0"
shift
@@ -143,11 +163,11 @@ exit /b 0
:help
echo.
echo Usage:
-echo publish.bat [portable^|single] [--skip-tests] [--no-pause]
+echo publish.bat [portable^|single] [x64^|arm64^|x86] [--skip-tests] [--no-pause]
echo.
echo Examples:
echo publish.bat portable
-echo publish.bat single --skip-tests
+echo publish.bat single arm64 --skip-tests
echo.
exit /b 1