From 5393988d41a20257270c9ba6a5046d094b55d8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E6=9D=B0?= <16899918+JasonWei512@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:22:50 +0800 Subject: [PATCH] Use native AOT toolchain to reduce binary size --- .github/workflows/dotnet.yml | 10 +++++----- EnergyStar/EnergyStar.csproj | 4 ++++ azure-pipelines.yml | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 3bf7085..5cafec8 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -20,14 +20,14 @@ jobs: - name: Test run: dotnet test --no-build --verbosity normal - name: Publish for win-x64 - run: dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishTrimmed=True + run: dotnet publish -c Release -r win-x64 --self-contained true - name: Publish for win-arm64 - run: dotnet publish -c Release -r win-arm64 --self-contained true -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishTrimmed=True + run: dotnet publish -c Release -r win-arm64 --self-contained true - uses: actions/upload-artifact@v3 with: name: release-win-x64 - path: /home/runner/work/EnergyStar/EnergyStar/EnergyStar/bin/Release/net6.0/win-x64/publish/EnergyStar.exe + path: ${{ github.workspace }}/EnergyStar/bin/Release/net6.0/win-x64/publish/EnergyStar.exe - uses: actions/upload-artifact@v3 with: name: release-win-arm64 - path: /home/runner/work/EnergyStar/EnergyStar/EnergyStar/bin/Release/net6.0/win-arm64/publish/EnergyStar.exe + path: ${{ github.workspace }}/EnergyStar/bin/Release/net6.0/win-arm64/publish/EnergyStar.exe diff --git a/EnergyStar/EnergyStar.csproj b/EnergyStar/EnergyStar.csproj index c1464b7..3758c95 100644 --- a/EnergyStar/EnergyStar.csproj +++ b/EnergyStar/EnergyStar.csproj @@ -14,4 +14,8 @@ + + + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8d19563..7479ac3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,7 +23,7 @@ steps: command: 'publish' publishWebProjects: false projects: 'EnergyStar/EnergyStar.csproj' - arguments: '-c ReleaseInvisible -r win-x64 --self-contained true -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishTrimmed=True' + arguments: '-c ReleaseInvisible -r win-x64 --self-contained true' zipAfterPublish: false modifyOutputPath: false @@ -33,7 +33,7 @@ steps: command: 'publish' publishWebProjects: false projects: 'EnergyStar/EnergyStar.csproj' - arguments: '-c ReleaseInvisible -r win-arm64 --self-contained true -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:PublishTrimmed=True' + arguments: '-c ReleaseInvisible -r win-arm64 --self-contained true' zipAfterPublish: false modifyOutputPath: false