-
Notifications
You must be signed in to change notification settings - Fork 21
187 lines (153 loc) · 5.37 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Build MAUI Project
on:
workflow_dispatch:
push:
branches:
- main
- "maui/*"
paths:
- 'src/MAUI/**/*'
- '.github/workflows/main_build-maui.yml'
env:
PROJECT_PATH: "src/MAUI/MauiDemo/MauiDemo.csproj"
NUGETCONFIG_PATH: "src/NuGet.Config"
TELERIK_USERNAME: ${{ secrets.MyTelerikAccountUsername }} # used by the NuGet.Config file
TELERIK_PASSWORD: ${{ secrets.MyTelerikAccountPassword }} # used by the NuGet.Config file
jobs:
# ***************************** #
# >>>>>>> Android build <<<<<<< #
# ***************************** #
maui-android:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.100-preview.7.23376.3'
- uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: '11'
- name: Generate version number using date and run number
shell: pwsh
id: version-creator
run: |
$buildDay = Get-Date -Format "yyyy.Mdd"
$ver = $buildDay + "." + $env:GITHUB_RUN_NUMBER + ".0"
echo "APP_VERSION=$ver" >> $GITHUB_OUTPUT
- name: Install MAUI workloads (required for GitHub-hosted runners)
shell: pwsh
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
- name: Restore NuGet packages
shell: pwsh
run: dotnet restore ${{ env.PROJECT_PATH }} --configfile ${{ env.NUGETCONFIG_PATH }}
- name: Build Maui Android project
shell: pwsh
run: dotnet build ${{ env.PROJECT_PATH }} -c Debug -f net8.0-android --no-restore -p:PublishTrimmed=False
# ***************************** #
# >>>>>>> Windows Build <<<<<<< #
# ***************************** #
maui-windows:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.100-preview.7.23376.3'
# For WinUI builds
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1.3
- name: Generate version number using date and run number
shell: pwsh
id: version-creator
run: |
$buildDay = Get-Date -Format "yyyy.Mdd"
$ver = $buildDay + "." + $env:GITHUB_RUN_NUMBER + ".0"
echo "APP_VERSION=$ver" >> $GITHUB_OUTPUT
- name: Install MAUI workloads (required for GitHub-hosted runners)
shell: pwsh
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
- name: Restore NuGet packages
shell: pwsh
run: dotnet restore ${{ env.PROJECT_PATH }} --configfile ${{ env.NUGETCONFIG_PATH }}
- name: Build Maui WinUI project
shell: pwsh
run: dotnet build ${{ env.PROJECT_PATH }} -c Debug -f net8.0-windows10.0.19041.0 -p:PublishTrimmed=False
# ************************* #
# >>>>>>> iOS Build <<<<<<< #
# ************************* #
maui-ios:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
#- uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: latest
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.100-preview.7.23376.3'
- name: Generate version number using date and run number
id: version-creator
shell: bash
run: |
buildDay=`date +%Y.%m%d`
echo $buildDay
ver="${buildDay}.${GITHUB_RUN_NUMBER}.0"
echo $ver
echo "APP_VERSION=$ver" >> $GITHUB_ENV
- name: Install MAUI workloads (required for GitHub-hosted runners)
shell: pwsh
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
- name: Restore NuGet packages
shell: bash
run: dotnet restore ${{ env.PROJECT_PATH }} --configfile ${{ env.NUGETCONFIG_PATH }}
- name: Build MAUI iOS project
shell: bash
run: dotnet build ${{ env.PROJECT_PATH }} -c Debug -f net8.0-ios --no-restore -p:PublishTrimmed=True -p:MtouchLink=SdkOnly
# ********************************* #
# >>>>>>> MacCatalyst Build <<<<<<< #
# ********************************* #
maui-macos:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
#- uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: latest
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.100-preview.7.23376.3'
- name: Generate version number using date and run number
id: version-creator
shell: bash
run: |
buildDay=`date +%Y.%m%d`
echo $buildDay
ver="${buildDay}.${GITHUB_RUN_NUMBER}.0"
echo $ver
echo "APP_VERSION=$ver" >> $GITHUB_ENV
- name: Install MAUI workloads (required for GitHub-hosted runners)
shell: pwsh
run: dotnet workload install maui --source https://api.nuget.org/v3/index.json
- name: Restore NuGet packages
shell: bash
run: dotnet restore ${{ env.PROJECT_PATH }} --configfile ${{ env.NUGETCONFIG_PATH }}
- name: Build MAUI MacCatalyst project
shell: bash
run: dotnet build ${{ env.PROJECT_PATH }} -f net8.0-maccatalyst -c Debug --no-restore -p:PublishTrimmed=True -p:MtouchLink=SdkOnly