forked from w-ahmad/WinUI.TableView
-
Notifications
You must be signed in to change notification settings - Fork 0
232 lines (195 loc) · 7.58 KB
/
Copy pathci-build-samples.yml
File metadata and controls
232 lines (195 loc) · 7.58 KB
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: ci-build-samples
on:
push:
branches: main
paths-ignore:
- 'docs/**'
pull_request:
branches: main
paths-ignore:
- 'docs/**'
jobs:
build-winui-sample:
runs-on: windows-latest
strategy:
matrix:
architecture: [x86, x64, ARM64]
steps:
- name: Checkout
uses: actions/checkout@v6.0.3
with:
submodules: recursive
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5.0.1
with:
dotnet-version: |
8.0.x
9.0.x
10.0.100
- name: Build WinUI sample app
run: |
msbuild /restore samples/WinUI.TableView.SampleApp/WinUI.TableView.SampleApp.csproj /p:Configuration=Release /p:Platform=${{ matrix.architecture }} /bl:artifacts/binlogs/build-winui-sample-${{ matrix.architecture }}.binlog
- name: Upload WinUI sample artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: winui-sample-${{ matrix.architecture }}
if-no-files-found: warn
path: |
samples/WinUI.TableView.SampleApp/bin/${{ matrix.architecture }}/Release/**
artifacts/binlogs/build-winui-sample-${{ matrix.architecture }}.binlog
build-uno-desktop:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6.0.3
with:
submodules: recursive
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5.0.1
with:
dotnet-version: |
8.0.x
9.0.x
10.0.100
- name: Restore Uno workloads
run: dotnet workload restore samples/WinUI.TableView.SampleApp.Uno/WinUI.TableView.SampleApp.Uno.csproj
- name: Build Uno desktop sample app
run: dotnet build samples/WinUI.TableView.SampleApp.Uno/WinUI.TableView.SampleApp.Uno.csproj -c Release -f net10.0-desktop -bl:artifacts/binlogs/build-uno-desktop.binlog
- name: Upload Uno desktop artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: uno-desktop
if-no-files-found: warn
path: |
samples/WinUI.TableView.SampleApp.Uno/bin/Release/net10.0-desktop/**
artifacts/binlogs/build-uno-desktop.binlog
build-uno-wasm:
env:
DIST_PATH: samples/WinUI.TableView.SampleApp.Uno/bin/Release/net10.0-browserwasm/publish/wwwroot
DotnetVersion: '10.0.100'
runs-on: ubuntu-latest
container: 'unoplatform/wasm-build:3.0'
steps:
- uses: actions/checkout@v6.0.3
with:
submodules: true
lfs: false
# When running on macos, set the DOTNET_INSTALL_DIR so a workspace local folder
# is used to install the SDK. This is required for the Uno.Sdk.Updater to work
- name: Set DOTNET_INSTALL_DIR
if: runner.os == 'macos' || runner.os == 'linux'
shell: bash
run: echo "DOTNET_INSTALL_DIR=$GITHUB_WORKSPACE/.dotnet" >> $GITHUB_ENV
- name: 'Set Wasm cache path'
shell: pwsh
run: echo "WasmCachePath=${{ github.workspace }}/.emscripten-cache" >> $env:GITHUB_ENV
- name: Cache EMSDK
id: cache-emsdk
uses: actions/cache@v4
env:
cache-name: cache-emsdk-modules
with:
path: ${{ env.WasmCachePath }}
key: ${{ runner.os }}-build-emsdk-${{ env.DotnetVersion }}
restore-keys: |
${{ runner.os }}-build-emsdk-${{ env.DotnetVersion }}
- name: Cache .NET
id: cache-dotnet
uses: actions/cache@v4
env:
cache-name: cache-dotnet-install
with:
path: ${{ github.workspace }}/.dotnet
key: ${{ runner.os }}-build-dotnet-${{ env.DotnetVersion }}
restore-keys: |
${{ runner.os }}-build-dotnet-${{ env.DotnetVersion }}
- name: Setup .NET
uses: actions/setup-dotnet@v5.0.1
with:
dotnet-version: ${{ env.DotnetVersion }}
- uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
id: nbgv
with:
toolVersion: 3.6.139
setAllVars: true
- name: Setup Workloads
run: |
cd samples/WinUI.TableView.SampleApp.Uno
dotnet workload restore
- name: Install Wasm Tools
run: |
cd samples/WinUI.TableView.SampleApp.Uno
dotnet workload install wasm-tools
- name: Build Uno wasm sample app
run: |
cd samples/WinUI.TableView.SampleApp.Uno
dotnet publish -c Release -f net10.0-browserwasm "/p:PackageVersion=${{ steps.nbgv.outputs.SemVer2 }}" -bl:artifacts/binlogs/build-uno-wasm.binlog
- name: Upload Uno wasm artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: uno-wasm
if-no-files-found: warn
path: |
samples/WinUI.TableView.SampleApp.Uno/bin/Release/net10.0-browserwasm/**
artifacts/binlogs/build-uno-wasm.binlog
deploy-uno-wasm:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build-uno-wasm
runs-on: ubuntu-latest
steps:
- name: Download Uno wasm artifacts
uses: actions/download-artifact@v7
with:
name: uno-wasm
path: wasm-dist
- name: Deploy to Azure Static Web Apps
id: builddeploy
continue-on-error: true
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LIVELY_GROUND_0D0F6A810 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "wasm-dist/samples/WinUI.TableView.SampleApp.Uno/bin/Release/net10.0-browserwasm/publish/wwwroot" # App source code path
api_location: "" # Api source code path - optional
output_location: "" # Built app content directory - optional
###### End of Repository/Build Configurations ######
build-uno-mobile:
if: false # Disabled for now.
runs-on: macos-latest
strategy:
matrix:
target_framework: [net10.0-android, net10.0-ios]
steps:
- name: Checkout
uses: actions/checkout@v6.0.3
with:
submodules: recursive
- name: Set DOTNET_INSTALL_DIR
shell: bash
run: echo "DOTNET_INSTALL_DIR=$GITHUB_WORKSPACE/.dotnet" >> "$GITHUB_ENV"
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5.0.1
with:
dotnet-version: |
8.0.x
9.0.x
10.0.100
- name: Restore Uno workloads
run: dotnet workload restore samples/WinUI.TableView.SampleApp.Uno/WinUI.TableView.SampleApp.Uno.csproj
- name: Install mobile workloads
run: dotnet workload install android ios
- name: Build Uno mobile sample app
run: dotnet build samples/WinUI.TableView.SampleApp.Uno/WinUI.TableView.SampleApp.Uno.csproj -c Release -f ${{ matrix.target_framework }} -bl:artifacts/binlogs/build-uno-mobile-${{ matrix.target_framework }}.binlog
- name: Upload Uno mobile artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: uno-mobile-${{ matrix.target_framework }}
if-no-files-found: warn
path: |
samples/WinUI.TableView.SampleApp.Uno/bin/Release/${{ matrix.target_framework }}/**
artifacts/binlogs/build-uno-mobile-${{ matrix.target_framework }}.binlog