Skip to content

Commit 8d19ef0

Browse files
authored
Merge pull request #9047 from unoplatform/dev/jela/winui-autoupdate
ci: autogenerate winui branch
2 parents 1d857b5 + 3125923 commit 8d19ef0

File tree

3 files changed

+93
-6
lines changed

3 files changed

+93
-6
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Update WinUI Generate Branch
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
env:
9+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10+
UnoCheck_Version: '1.4.1'
11+
UnoCheck_Manifest: 'https://raw.githubusercontent.com/unoplatform/uno.check/8c7f669060a6cca50f71bb0845281c424ad7eb0d/manifests/uno.ui-preview.manifest.json'
12+
13+
jobs:
14+
build:
15+
name: update-winui-branch
16+
runs-on: windows-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Setup .NET Core v6
24+
uses: actions/setup-dotnet@v1
25+
with:
26+
dotnet-version: '6.0.300'
27+
28+
- name: Setup GitVersion
29+
uses: gittools/actions/gitversion/[email protected]
30+
with:
31+
versionSpec: '5.x'
32+
33+
- name: GitVersion
34+
id: gitversion
35+
uses: gittools/actions/gitversion/[email protected]
36+
with:
37+
useConfigFile: true
38+
configFilePath: gitversion.yml
39+
40+
- name: setup git config
41+
run: |
42+
git config user.name "GitHub Actions Bot"
43+
git config user.email "<>"
44+
45+
- name: Add msbuild to PATH
46+
uses: microsoft/[email protected]
47+
48+
- run: |
49+
echo "JAVA_HOME=$env:JAVA_HOME_11_X64" >> $env:GITHUB_ENV
50+
echo "JavaSdkDirectory=$env:JAVA_HOME_11_X64" >> $env:GITHUB_ENV
51+
name: Select JDK 11
52+
53+
- run: |
54+
& dotnet tool update --global uno.check --version $env:UnoCheck_Version --add-source https://api.nuget.org/v3/index.json
55+
& uno-check -v --ci --non-interactive --fix --skip xcode --skip gtk3 --skip vswin --skip vsmac --manifest $env:UnoCheck_Manifest
56+
name: Install .NET Workloads
57+
58+
- name: Convert source tree to WinUI
59+
run: |
60+
cd $env:GITHUB_WORKSPACE\src\Uno.WinUIRevert
61+
dotnet run "$env:GITHUB_WORKSPACE"
62+
63+
- name: Run API Sync Tool
64+
run: |
65+
cd $env:GITHUB_WORKSPACE\build
66+
msbuild Uno.UI.Build.csproj "/p:CombinedConfiguration=Release|AnyCPU" /m /t:RunAPISyncTool /bl
67+
68+
- name: commit
69+
run: |
70+
git add .
71+
git commit -m "Update WinUI Autoconvert from $env:GITHUB_SHA"
72+
git checkout -b generated/$env:GITHUB_HEAD_REF/winui-autoconvert
73+
git merge $env:GITHUB_HEAD_REF
74+
git push origin generated/$env:GITHUB_HEAD_REF/winui-autoconvert

doc/articles/uno-development/winui-conversion.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
The current Uno source tree is based on UWP, and the CI uses a specific step to generate the WinUI 3.0 compatible API set, and the associated packages.
44

5+
## Using the auto-generated synchronized branch
6+
The Uno CI automatically maintains a WinUI-converted branch of the tree after every push to tracked branches, in order to get started faster when debugging WinUI related issues.
7+
8+
The branch is maintained as follows:
9+
```
10+
generated\[branch]\winui-autoconvert
11+
```
12+
13+
You can checkout this branch locally to get started faster.
14+
15+
## The conversion process
516
The conversion process is done as follows, from a clean repository:
617
- The `Uno.WinUIRevert` is removing and moving folders from the UWP structure to adjust to the WinUI structure
718
- The `Uno.UWPSyncGenerator` is run to regenerate the whole WinRT/WinUI 3.0 API set
@@ -11,6 +22,7 @@ To ease the adjustments when conversion issues arise:
1122
- The `UNO_UWP_BUILD` msbuild variable is set to `true` when the tree is "UWP" mode, and undefined when the tree is in WinUI mode.
1223
- The `HAS_UNO_WINUI` C# constant is defined when the tree is built in WinUI mode.
1324

25+
## Converting a local source tree
1426
The conversion process can be run locally as follows:
1527
- cd `uno-repo\build`
1628
- `convert-sourcetree-to-winui.cmd`
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net5.0</TargetFramework>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net5.0</TargetFramework>
6+
<RollForward>major</RollForward>
67

7-
<!-- Required for non-net6 CI build -->
8-
<LangVersion>9.0</LangVersion>
9-
</PropertyGroup>
8+
<!-- Required for non-net6 CI build -->
9+
<LangVersion>9.0</LangVersion>
10+
</PropertyGroup>
1011

1112
</Project>

0 commit comments

Comments
 (0)