-
Notifications
You must be signed in to change notification settings - Fork 21
153 lines (120 loc) · 4.8 KB
/
main_build-maui.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: MAUI
on:
workflow_dispatch:
push:
branches:
- main
- "maui/*"
paths:
- 'src/MAUI/**/*'
- '.github/workflows/main_build-maui.yml'
env:
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