diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index b1e411605..b93d66fd1 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -84,6 +84,8 @@ jobs: environment: ${{ needs.preflight.outputs.package-env }} permissions: contents: read + env: + NUGET_PACKAGES: ${{ github.workspace }}\.nuget\packages strategy: fail-fast: false matrix: @@ -93,24 +95,19 @@ jobs: - name: Checkout uses: actions/checkout@v6 - - name: Install Windows SDK UAP platform - shell: pwsh - run: | - # CsWinRT in WindowsPackageManager.Interop requires UAP 10.0.19041.0 platform metadata - $VsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" - $VsInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe" - $InstallPath = & $VsWhere -latest -property installationPath - & $VsInstaller modify --installPath $InstallPath ` - --add Microsoft.VisualStudio.Component.UWP.Support ` - --add Microsoft.VisualStudio.Component.Windows10SDK.19041 ` - --quiet --norestart --nocache | Out-Default - Write-Host "Windows SDK UAP platform installed" - - name: Install .NET uses: actions/setup-dotnet@v5 with: dotnet-version: 8.0.x + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ${{ env.NUGET_PACKAGES }} + key: ${{ runner.os }}-nuget-${{ hashFiles('src/**/*.csproj', 'src/**/*.props', 'src/**/*.targets', 'src/**/*.sln') }} + restore-keys: | + ${{ runner.os }}-nuget- + - name: Install Python uses: actions/setup-python@v6 with: diff --git a/.github/workflows/dotnet-test.yml b/.github/workflows/dotnet-test.yml index 4e2ad44cc..1a63e7928 100644 --- a/.github/workflows/dotnet-test.yml +++ b/.github/workflows/dotnet-test.yml @@ -21,6 +21,8 @@ on: jobs: test-codebase: runs-on: windows-latest + env: + NUGET_PACKAGES: ${{ github.workspace }}\.nuget\packages steps: - name: Checkout the repository @@ -28,36 +30,23 @@ jobs: with: fetch-depth: 0 - # Install the .NET Core workload - name: Install .NET Core uses: actions/setup-dotnet@v5 with: dotnet-version: 8.0.x - - name: Install Windows SDK UAP platform - shell: pwsh - run: | - # CsWinRT in WindowsPackageManager.Interop requires UAP 10.0.19041.0 platform metadata - $VsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" - $VsInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe" - $InstallPath = & $VsWhere -latest -property installationPath - & $VsInstaller modify --installPath $InstallPath ` - --add Microsoft.VisualStudio.Component.UWP.Support ` - --add Microsoft.VisualStudio.Component.Windows10SDK.19041 ` - --quiet --norestart --nocache | Out-Default - Write-Host "Windows SDK UAP platform installed" - - # - name: Install WinGet - # uses: Cyberboss/install-winget@v1 + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ${{ env.NUGET_PACKAGES }} + key: ${{ runner.os }}-nuget-${{ hashFiles('src/**/*.csproj', 'src/**/*.props', 'src/**/*.targets', 'src/**/*.sln') }} + restore-keys: | + ${{ runner.os }}-nuget- - name: Install dependencies working-directory: src run: dotnet restore UniGetUI.sln - # - name: Test build - # working-directory: src - # run: dotnet build --configuration Release - - name: Run Tests working-directory: src run: dotnet test UniGetUI.sln --no-restore --verbosity q --nologo diff --git a/src/WindowsPackageManager.Interop/ExternalLibraries.WindowsPackageManager.Interop.csproj b/src/WindowsPackageManager.Interop/ExternalLibraries.WindowsPackageManager.Interop.csproj index aab72c57c..0ad23b000 100644 --- a/src/WindowsPackageManager.Interop/ExternalLibraries.WindowsPackageManager.Interop.csproj +++ b/src/WindowsPackageManager.Interop/ExternalLibraries.WindowsPackageManager.Interop.csproj @@ -17,7 +17,8 @@ https://github.com/microsoft/CsWinRT/blob/master/nuget/readme.md --> - 10.0.19041.0 + $(PkgMicrosoft_Windows_SDK_Contracts)\ref\netstandard2.0 + 10.0.26100.0 Microsoft.Management.Deployment @@ -29,6 +30,10 @@ + + true + none + all runtime; build; native; contentfiles; analyzers