-
Notifications
You must be signed in to change notification settings - Fork 4
129 lines (106 loc) · 4.36 KB
/
ci.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
name: CI
on:
push:
branches:
- main
- release/**
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- release/**
env:
UnoCheck_Version: '1.27.2'
jobs:
build:
name: Build
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
with:
toolVersion: 3.6.139
setAllVars: true
- run: |
npm install -g [email protected]
conventional-changelog -p angular -u -r 1 -o "build/changelog.md"
name: 'Generate changelog.md'
- run: |
& dotnet tool update --global uno.check --version ${{ env.UnoCheck_Version }} --add-source https://api.nuget.org/v3/index.json
& uno-check -v --ci --non-interactive --fix --skip xcode --skip androidemulator --skip gtk3 --skip vswin --skip vsmac
name: Install .NET Workloads
- name: Adjust msbuild task name
run: |
cd src
gci -r -File -Include *.cs,*.targets,*.props,*.csproj | foreach-object { $a = $_.fullname; ( get-content $a ) | foreach-object { $_ -replace "v0","$env:NBGV_GitCommitId" } | set-content $a }
- name: Build - CI
run: |
gci -r -File -Include src\*.cs,src\*.targets,src\*.props | foreach-object { $a = $_.fullname; ( get-content $a ) | foreach-object { $_ -replace "v0","$env:NBGV_GitCommitId" } | set-content $a }
$msbuild = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
& $msbuild /r /p:Configuration=Release /nr:false "/t:Build;Pack" /p:PackageVersion=$env:NBGV_SemVer2 /p:Version=$env:NBGV_SemVer2 "/p:InformationalVersion=$env:NBGV_SemVer2+$env:env.BuildingRef" "/p:PackageOutputPath=$env:GITHUB_WORKSPACE\artifacts" "/p:PackageReleaseNotesFile=$env:GITHUB_WORKSPACE\build\changelog.md" src\Uno.XamlMerge.Task\Uno.XamlMerge.Task.csproj
- name: Run Unit Tests
run: |
cd src\Uno.XamlMerge.Tests
dotnet test
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet
path: .\artifacts
validate:
name: Validate Sample App
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.403'
- run: |
& dotnet tool update --global uno.check --version ${{ env.UnoCheck_Version }} --add-source https://api.nuget.org/v3/index.json
& uno-check -v --ci --non-interactive --fix --skip xcode --skip androidemulator --skip gtk3 --skip vswin --skip vsmac --manifest ${{ env.UnoCheck_Manifest }}
name: Install .NET Workloads
- name: Build task project
run: |
cd src\Uno.XamlMerge.Task
dotnet build -c Release
- name: Validate Test Projects
run: |
$msbuild = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
& $msbuild /m /nr:false /r /p:Configuration=Release build\Uno.XamlMerge.Task-ci-only.slnf /p:AppxPackageSigningEnabled=false /p:AotAssemblies=false /p:WasmShellILLinkerEnabled=false
publish:
name: Publish
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}
runs-on: windows-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet
path: artifacts
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Setup SignClient
run: |
dotnet tool install --tool-path build SignClient
- name: SignClient
run: |
if ("${{ secrets.SIGN_CLIENT_USER }}" -ne "")
{
build\SignClient sign -i artifacts\*.nupkg -c build\SignClient.json -r "${{ secrets.SIGN_CLIENT_USER }}" -s "${{ secrets.SIGN_CLIENT_SECRET }}" -n "Uno.Check" -d "Uno.Check" -u "https://github.com/unoplatform/uno.check"
}
- name: NuGet Push
run: |
dotnet nuget push artifacts\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_API_KEY }}