Skip to content

Update MySite.Web.csproj #181

Update MySite.Web.csproj

Update MySite.Web.csproj #181

# This example shows you how you can use the 'dotnet nuget update source' command to set the credentials
name: MAUI
on:
workflow_dispatch:
push:
branches:
- main
- "maui/*"
paths:
- 'src/MAUI/**/*'
- '.github/workflows/main_build-maui.yml'
env:
TELERIK_LICENSE: ${{secrets.TELERIK_LICENSE_KEY}}
PROJECT_PATH: "src/MAUI/MauiDemo.csproj"
NUGETCONFIG_PATH: "src/NuGet.Config"
DOTNET_VERSION: "9.0.x"
WINUI_TFM: "net9.0-windows10.0.22621.0"
ANDROID_TFM: "net9.0-android"
IOS_TFM: "net9.0-ios"
MACCATALYST_TFM: "net9.0-maccatalyst"
jobs:
# ***************************** #
# >>>>>>> Windows Build <<<<<<< #
# ***************************** #
maui-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.DOTNET_VERSION}}
# For WinUI builds
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Install MAUI workloads
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
- name: Set Telerik NuGet Credentials
run: dotnet nuget update source 'Telerik_v3_Feed' -s 'https://nuget.telerik.com/v3/index.json' -u 'api-key' -p "${{secrets.TELERIK_NUGET_KEY}}" --configfile 'src/NuGet.Config' --store-password-in-clear-text
- name: Restore NuGet packages
run: dotnet restore ${{env.PROJECT_PATH}} --configfile ${{env.NUGETCONFIG_PATH}}
- name: Build Maui WinUI project
run: dotnet build ${{env.PROJECT_PATH}} -c Debug -f ${{env.WINUI_TFM}}
# ***************************** #
# >>>>>>> Android build <<<<<<< #
# ***************************** #
maui-android:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.DOTNET_VERSION}}
- uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '11'
- name: Install MAUI workloads
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
- name: Set Telerik NuGet Credentials
run: dotnet nuget update source 'Telerik_v3_Feed' -s 'https://nuget.telerik.com/v3/index.json' -u 'api-key' -p "${{secrets.TELERIK_NUGET_KEY}}" --configfile 'src/NuGet.Config' --store-password-in-clear-text
- name: Restore NuGet packages
run: dotnet restore ${{env.PROJECT_PATH}} --configfile ${{env.NUGETCONFIG_PATH}}
- name: Build Maui Android project
run: dotnet build ${{env.PROJECT_PATH}} -c Debug -f ${{env.ANDROID_TFM}} --no-restore -p:PublishTrimmed=False
# ************************* #
# >>>>>>> iOS Build <<<<<<< #
# ************************* #
maui-ios:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.1
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.DOTNET_VERSION}}
- name: Install MAUI workloads
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
- name: Set Telerik NuGet Credentials
run: dotnet nuget update source 'Telerik_v3_Feed' -s 'https://nuget.telerik.com/v3/index.json' -u 'api-key' -p "${{secrets.TELERIK_NUGET_KEY}}" --configfile 'src/NuGet.Config' --store-password-in-clear-text
- name: Restore NuGet packages
run: dotnet restore ${{env.PROJECT_PATH}} --configfile ${{env.NUGETCONFIG_PATH}}
- name: Build MAUI iOS project
run: dotnet build ${{env.PROJECT_PATH}} -c Debug -f ${{env.IOS_TFM}} --no-restore -p:PublishTrimmed=True -p:MtouchLink=SdkOnly
# ********************************* #
# >>>>>>> MacCatalyst Build <<<<<<< #
# ********************************* #
maui-macos:
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.1
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.DOTNET_VERSION}}
- name: Install MAUI workloads
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
- name: Set Telerik NuGet Credentials
run: dotnet nuget update source 'Telerik_v3_Feed' -s 'https://nuget.telerik.com/v3/index.json' -u 'api-key' -p "${{secrets.TELERIK_NUGET_KEY}}" --configfile 'src/NuGet.Config' --store-password-in-clear-text
- name: Restore NuGet packages
run: dotnet restore ${{env.PROJECT_PATH}} --configfile ${{env.NUGETCONFIG_PATH}}
- name: Build MAUI MacCatalyst project
run: dotnet build ${{env.PROJECT_PATH}} -f ${{env.MACCATALYST_TFM}} -c Debug --no-restore -p:PublishTrimmed=True -p:MtouchLink=SdkOnly