-
Notifications
You must be signed in to change notification settings - Fork 7
127 lines (106 loc) · 3.94 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
name: CI
on:
push:
branches:
- main
- release/**
- legacy/**
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- release/**
- legacy/**
env:
UnoCheck_Version: '1.11.0-dev.2'
UnoCheck_Manifest: 'https://raw.githubusercontent.com/unoplatform/uno.check/146b0b4b23d866bef455494a12ad7ffd2f6f2d20/manifests/uno.ui.manifest.json'
jobs:
build_tool:
name: Build
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.408'
- name: Setup .NET 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.100'
- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.6.11'
- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: gitversion.yml
- 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","${{ steps.gitversion.outputs.VersionSourceSha }}" } | set-content $a }
- 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 - CI
run: |
$adjustedPackageVersion="${{ steps.gitversion.outputs.semVer }}".ToLower();
dotnet pack -c Release -p:PackageVersion=$adjustedPackageVersion -p:Version=${{ steps.gitversion.outputs.assemblySemVer }} -o .\artifacts src/Resizetizer/src/Resizetizer.csproj
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: NuGet
path: .\artifacts
- name: Run UnitTests
run: |
dotnet test src/Resizetizer/test/UnitTests/Resizetizer.UnitTests.csproj
- name: Validate sample app
run: |
$msbuild = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
& $msbuild /r /bl:.\logs\samples.binlog samples\NewTemplate\Resizetizer.Extensions.Sample.sln /p:AotAssemblies=false /p:WasmShellILLinkerEnabled=false
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: logs
path: .\logs
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_tool
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
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
shell: pwsh
run: |
build\SignClient sign -i artifacts\*.nupkg -c build\SignClient.json -r "${{ secrets.UNO_PLATFORM_CODESIGN_USERNAME }}" -s "${{ secrets.UNO_PLATFORM_CODESIGN_SECRET }}" -n "uno.resizetizer" -d "uno.resizetizer" -u "https://github.com/unoplatform/uno.resizetizer"
- name: Upload Signed Artifacts
uses: actions/upload-artifact@v2
with:
name: NuGet-Signed
path: .\artifacts
- name: NuGet Push
shell: pwsh
run: |
dotnet nuget push artifacts\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_API_KEY }}