Skip to content

Update MyWpfApp.csproj #168

Update MyWpfApp.csproj

Update MyWpfApp.csproj #168

# This example shows you how you can use the named environment variables in the nuget.config file to set the credentials
name: WPF (.NET Framework)
on:
workflow_dispatch:
push:
branches:
- main
- "wpf/*"
paths:
- 'src/Wpf/**/*'
- '.github/workflows/main_build-wpf.yml'
env:
TELERIK_USERNAME: "api-key" # Variable name used in the nuget.config file
TELERIK_PASSWORD: ${{secrets.TELERIK_NUGET_KEY}} # Variable name used in the nuget.config file
TELERIK_LICENSE: ${{secrets.TELERIK_LICENSE_KEY}} # Used when compiling the project
CSPROJ_PATH: "src/Wpf/MyWpfApp/MyWpfApp.csproj"
NUGETCONFIG_PATH: "src/NuGet.Config"
jobs:
build_desktop:
runs-on: windows-latest
strategy:
matrix:
configuration: [Release]
platform: [x86, x64]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
# We use the dotnet CLI (instead of nuget.exe) to restore the nuget packages before using msbuild
- name: NuGet Restore
run: dotnet restore ${{env.CSPROJ_PATH}} --configfile ${{env.NUGETCONFIG_PATH}} --runtime win-${{matrix.platform}}
# Use msbuild to compile the .NET Framework WPF project
- name: Build the WPF application
run: msbuild ${{env.CSPROJ_PATH}} /t:Restore /p:Configuration=${{matrix.configuration}} /p:RuntimeIdentifier=win-${{matrix.platform}}