Skip to content

Commit 2599879

Browse files
authored
Merge pull request #337 from w-ahmad/chore/move-samples
chore: move samples app into main repository
2 parents d5a5360 + 8c7a5f6 commit 2599879

File tree

113 files changed

+6503
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+6503
-8
lines changed
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Azure Static Web Apps CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened, closed]
9+
branches:
10+
- main
11+
12+
jobs:
13+
build_and_deploy_job:
14+
env:
15+
DIST_PATH: samples/WinUI.TableView.SampleApp.Uno/bin/Release/net10.0-browserwasm/publish/wwwroot
16+
DotnetVersion: '10.0.100'
17+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
18+
runs-on: ubuntu-latest
19+
container: 'unoplatform/wasm-build:3.0'
20+
name: Build and Deploy Job
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
submodules: true
25+
lfs: false
26+
27+
# When running on macos, set the DOTNET_INSTALL_DIR so a workspace local folder
28+
# is used to install the SDK. This is required for the Uno.Sdk.Updater to work
29+
- name: Set DOTNET_INSTALL_DIR
30+
if: runner.os == 'macos' || runner.os == 'linux'
31+
shell: bash
32+
run: echo "DOTNET_INSTALL_DIR=$GITHUB_WORKSPACE/.dotnet" >> $GITHUB_ENV
33+
34+
- name: 'Set Wasm cache path'
35+
shell: pwsh
36+
run: echo "WasmCachePath=${{ github.workspace }}/.emscripten-cache" >> $env:GITHUB_ENV
37+
38+
- name: Cache EMSDK
39+
id: cache-emsdk
40+
uses: actions/cache@v4
41+
env:
42+
cache-name: cache-emsdk-modules
43+
with:
44+
path: ${{ env.WasmCachePath }}
45+
key: ${{ runner.os }}-build-emsdk-${{ env.ValidationUnoCheckVersion }}
46+
restore-keys: |
47+
${{ runner.os }}-build-emsdk-${{ env.ValidationUnoCheckVersion }}
48+
49+
- name: Cache .NET
50+
id: cache-dotnet
51+
uses: actions/cache@v4
52+
env:
53+
cache-name: cache-dotnet-install
54+
with:
55+
path: ${{ github.workspace }}/.dotnet
56+
key: ${{ runner.os }}-build-dotnet-${{ env.DotnetVersion }}
57+
restore-keys: |
58+
${{ runner.os }}-build-dotnet-${{ env.DotnetVersion }}
59+
60+
- name: Setup .NET
61+
uses: actions/setup-dotnet@v1.7.2
62+
with:
63+
dotnet-version: ${{ env.DotnetVersion }}
64+
65+
- uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
66+
id: nbgv
67+
with:
68+
toolVersion: 3.6.139
69+
setAllVars: true
70+
71+
- run: |
72+
cd samples/WinUI.TableView.SampleApp.Uno
73+
dotnet workload restore
74+
name: Setup Workloads
75+
76+
- run: |
77+
cd samples/WinUI.TableView.SampleApp.Uno
78+
dotnet workload install wasm-tools
79+
name: Setup Workloads
80+
81+
- run: |
82+
cd samples/WinUI.TableView.SampleApp.Uno
83+
dotnet publish -c Release -f net10.0-browserwasm "/p:PackageVersion=${{ steps.nbgv.outputs.SemVer2 }}" /p:EnableWindowsTargeting=true /bl:../binlogs/output.binlog
84+
name: Build Uno Wasm App
85+
86+
- uses: actions/upload-artifact@v4
87+
with:
88+
name: wasm-site
89+
path: ${{ env.DIST_PATH }}
90+
91+
- uses: actions/upload-artifact@v4
92+
with:
93+
name: logs
94+
path: binlogs
95+
96+
- name: Build And Deploy
97+
id: builddeploy
98+
continue-on-error: true
99+
uses: Azure/static-web-apps-deploy@v1
100+
with:
101+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LIVELY_GROUND_0D0F6A810 }}
102+
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
103+
action: "upload"
104+
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
105+
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
106+
app_location: "${{ env.DIST_PATH }}" # App source code path
107+
api_location: "" # Api source code path - optional
108+
output_location: "" # Built app content directory - optional
109+
###### End of Repository/Build Configurations ######
110+
111+
close_pull_request_job:
112+
if: github.event_name == 'pull_request' && github.event.action == 'closed'
113+
runs-on: ubuntu-latest
114+
name: Close Pull Request Job
115+
steps:
116+
- name: Close Pull Request
117+
id: closepullrequest
118+
uses: Azure/static-web-apps-deploy@v1
119+
with:
120+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LIVELY_GROUND_0D0F6A810 }}
121+
action: "close"
122+
123+

.github/workflows/cd-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
build:
10-
runs-on: windows-2022
10+
runs-on: windows-latest
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v4.1.4
@@ -18,7 +18,7 @@ jobs:
1818
dotnet-version: |
1919
8.0.x
2020
9.0.x
21-
10.0.x
21+
10.0.100
2222
2323
- name: Setup MSBuild.exe
2424
uses: microsoft/setup-msbuild@v2
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: ci-build-samples
2+
3+
on:
4+
push:
5+
branches: main
6+
paths-ignore:
7+
- 'docs/**'
8+
9+
pull_request:
10+
branches: main
11+
paths-ignore:
12+
- 'docs/**'
13+
14+
jobs:
15+
build:
16+
runs-on: windows-latest
17+
18+
strategy:
19+
matrix:
20+
architecture: [x86, x64, ARM64]
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4.1.4
25+
with:
26+
submodules: recursive
27+
28+
- name: Setup MSBuild.exe
29+
uses: microsoft/setup-msbuild@v2
30+
31+
- name: Setup .NET Core SDK
32+
uses: actions/setup-dotnet@v5.0.1
33+
with:
34+
dotnet-version: |
35+
8.0.x
36+
9.0.x
37+
10.0.100
38+
39+
- name: Build
40+
run: |
41+
msbuild /restore samples/WinUI.TableView.SampleApp/WinUI.TableView.SampleApp.csproj /p:Configuration=Release /p:Platform=${{ matrix.architecture }}

.github/workflows/ci-build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ on:
55
branches: main
66
paths-ignore:
77
- 'docs/**'
8+
- 'samples/**'
89
pull_request:
910
branches: main
1011
paths-ignore:
1112
- 'docs/**'
13+
- 'samples/**'
1214

1315
jobs:
1416
build:
15-
runs-on: windows-2022
17+
runs-on: windows-latest
1618
steps:
1719
- name: Checkout
1820
uses: actions/checkout@v4.1.4
@@ -26,8 +28,7 @@ jobs:
2628
dotnet-version: |
2729
8.0.x
2830
9.0.x
29-
10.0.x
30-
31+
10.0.100
3132
- name: Build
3233
run: |
3334
msbuild /restore `
@@ -58,7 +59,7 @@ jobs:
5859

5960
publish:
6061
needs: build
61-
runs-on: windows-2022
62+
runs-on: windows-latest
6263
environment: ci-nuget-publish
6364
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
6465
steps:

.github/workflows/ci-docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ name: ci-docs
33
on:
44
push:
55
branches: main
6+
paths-ignore:
7+
- 'samples/**'
68

79
jobs:
810
build:
9-
runs-on: windows-2022
11+
runs-on: windows-latest
1012
steps:
1113
- name: Checkout
1214
uses: actions/checkout@v4.1.4
@@ -17,7 +19,7 @@ jobs:
1719
dotnet-version: |
1820
8.0.x
1921
9.0.x
20-
10.0.x
22+
10.0.100
2123
2224
- name: Install DocFX
2325
run: dotnet tool update -g docfx

WinUI.TableView.slnx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<Solution>
2+
<Folder Name="/samples/">
3+
<Project Path="samples/WinUI.TableView.SampleApp.Uno/WinUI.TableView.SampleApp.Uno.csproj" />
4+
<Project Path="samples/WinUI.TableView.SampleApp/WinUI.TableView.SampleApp.csproj">
5+
<Platform Project="x64" />
6+
<Deploy />
7+
</Project>
8+
</Folder>
29
<Project Path="src/WinUI.TableView.csproj" />
310
<Project Path="tests/WinUI.TableView.Tests.csproj">
411
<Platform Project="x64" />

global.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"msbuild-sdks": {
3+
"Uno.Sdk": "6.4.53"
4+
},
5+
"sdk": {
6+
"version": "10.0.100",
7+
"rollForward": "patch",
8+
"allowPrerelease": false
9+
}
10+
}

samples/Directory.Build.props

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project>
2+
<PropertyGroup>
3+
<NetVersion>net10.0</NetVersion>
4+
<LangVersion>preview</LangVersion>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<RootNamespace>WinUI.TableView.SampleApp</RootNamespace>
8+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
9+
10+
<!--
11+
Adding NoWarn to remove build warnings
12+
NU1507: Warning when there are multiple package sources when using CPM with no source mapping
13+
NETSDK1201: Warning that specifying RID won't create self containing app
14+
PRI257: Ignore default language (en) not being one of the included resources (eg en-us, en-uk)
15+
-->
16+
<NoWarn>$(NoWarn);NU1507;NETSDK1201;PRI257</NoWarn>
17+
</PropertyGroup>
18+
</Project>

samples/Directory.Packages.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project ToolsVersion="15.0">
2+
<ItemGroup>
3+
<PackageVersion Include="ColorCode.WinUI" Version="2.0.15" />
4+
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
5+
<PackageVersion Include="CommunityToolkit.WinUI.Controls.ColorPicker" Version="8.1.240916" />
6+
<PackageVersion Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.1.240916" />
7+
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="9.0.4" />
8+
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
9+
<PackageVersion Include="ClosedXML" Version="0.105.0" />
10+
<PackageVersion Include="WinUIEx" Version="2.6.0" />
11+
</ItemGroup>
12+
</Project>
Lines changed: 42 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)