Skip to content

Commit 3f197b1

Browse files
authored
chore: Adjust compiler assets, remove unused contents
1 parent 1b9f2ec commit 3f197b1

File tree

5 files changed

+181
-23
lines changed

5 files changed

+181
-23
lines changed

.github/workflows/runtime-ci.yml

+58-23
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616
DOTNETRUNTIME_COMMIT: be32947d322ae71526ad1dde412a1dca44ea4fba
1717
DOTNETSDK_VERSION: 9.0.100-preview.6.24328.19
1818
ADDITIONAL_BUILD_ARGS: '/p:MonoEnableAssertMessages=true /p:WasmEnableES6=true /p:WasmExceptionHandling=true'
19+
GitVersion_Version: 5.10.3
1920

2021
concurrency:
2122
group: ${{github.workflow}} - ${{github.ref}}
@@ -42,7 +43,19 @@ jobs:
4243
- uses: actions/checkout@v2
4344
with:
4445
submodules: true
45-
46+
47+
- name: Setup GitVersion
48+
uses: gittools/actions/gitversion/[email protected]
49+
with:
50+
versionSpec: ${{ env.GitVersion_Version }}
51+
52+
- name: GitVersion
53+
id: gitversion
54+
uses: gittools/actions/gitversion/[email protected]
55+
with:
56+
useConfigFile: true
57+
configFilePath: build/gitversion.yml
58+
4659
- name: Set Variable from current Commit
4760
run: |
4861
Invoke-Expression "git rev-parse --short HEAD" | Out-String -NoNewLine -OutVariable CURRENT_COMMIT
@@ -70,26 +83,20 @@ jobs:
7083
7184
- name: Create artifact structure
7285
run: |
73-
New-Item -ItemType Directory -Force -Path ./runtime/artifacts/packages/Release/Shipping/uno/runtimes/browser-wasm/native
74-
cd ./runtime/artifacts/packages/Release/Shipping/uno
86+
New-Item -ItemType Directory -Force -Path $env:GITHUB_WORKSPACE/nuget/tools
87+
New-Item -ItemType Directory -Force -Path $env:GITHUB_WORKSPACE/ci-output
7588
7689
# Move cross compiler to appropriate location
77-
move $env:GITHUB_WORKSPACE\runtime\artifacts\bin\mono\Browser.wasm.Release\cross runtimes\browser-wasm\native
78-
79-
- name: Zip Archive
80-
run: |
90+
move $env:GITHUB_WORKSPACE\runtime\artifacts\bin\mono\Browser.wasm.Release\cross $env:GITHUB_WORKSPACE/nuget/tools
8191
82-
Invoke-Expression "Get-Location | select -ExpandProperty Path" | Out-String -NoNewLine -OutVariable Current_Path
83-
$ARTIFACTS_FOLDER="$Current_Path\ci-artifacts"
84-
mkdir -p $ARTIFACTS_FOLDER
85-
cd .\runtime\artifacts\packages\Release\Shipping\uno
86-
Compress-Archive -DestinationPath $ARTIFACTS_FOLDER\dotnet-aot-wasm-windows-$env:CURRENT_COMMIT-$env:BASE_DOTNET_SHORT_COMMIT-${{ github.run_id }}-$env:BUILD_CONFIGURATION$archiveConfiguration.zip -Path *
92+
cd $env:GITHUB_WORKSPACE/nuget
93+
dotnet pack Uno.NETCore.App.Runtime.AOT.Cross.browser-wasm.csproj /p:OutputPath=$GITHUB_WORKSPACE/ci-output "/p:Version=${{ steps.gitversion.outputs.semVer }}"
8794
8895
- uses: actions/upload-artifact@v2
8996
if: ${{ always() }}
9097
with:
91-
name: wasm
92-
path: ci-artifacts
98+
name: nuget
99+
path: ci-output
93100

94101
##
95102
## Build Job
@@ -105,6 +112,22 @@ jobs:
105112
MONO_WASM_THREADS: ['multithread', 'singlethread']
106113

107114
steps:
115+
- uses: actions/checkout@v2
116+
with:
117+
submodules: true
118+
119+
- name: Setup GitVersion
120+
uses: gittools/actions/gitversion/[email protected]
121+
with:
122+
versionSpec: ${{ env.GitVersion_Version }}
123+
124+
- name: GitVersion
125+
id: gitversion
126+
uses: gittools/actions/gitversion/[email protected]
127+
with:
128+
useConfigFile: true
129+
configFilePath: build/gitversion.yml
130+
108131
- name: Setup .NET SDK
109132
uses: actions/[email protected]
110133
with:
@@ -139,10 +162,6 @@ jobs:
139162
- name: Trust My Directory
140163
run: git config --global --add safe.directory /__w/Uno.DotnetRuntime.WebAssembly/Uno.DotnetRuntime.WebAssembly
141164

142-
- uses: actions/checkout@v2
143-
with:
144-
submodules: true
145-
146165
- name: Set Variable from current Commit
147166
run: |
148167
set -e
@@ -184,15 +203,19 @@ jobs:
184203
unzip -o '*.nupkg' -d uno
185204
cd uno
186205
rm *.nuspec
206+
207+
# remove unused assets that are part of the official SDK
187208
rm -fR _rels
188209
rm -fR package
210+
rm -fR analyzers
211+
rm -fR ref
212+
rm -f \[Content_Types\].xml
213+
rm -f Icon.png
214+
rm -f LICENCE.TXT
215+
find data ! -name 'RuntimeList.xml' -type f -exec rm -f {} +
189216
190217
- name: Zip Archive
191218
run: |
192-
if [ '${{ matrix.MONO_WASM_THREADS }}' != 'singlethread' ]; then
193-
ARCHIVE_CONFIGURATION="-threads";
194-
fi
195-
196219
ARTIFACTS_FOLDER=`pwd`/ci-artifacts
197220
mkdir -p $ARTIFACTS_FOLDER
198221
cd ./runtime/artifacts/packages/Release/Shipping/uno
@@ -213,6 +236,18 @@ jobs:
213236
with:
214237
submodules: true
215238

239+
- name: Setup GitVersion
240+
uses: gittools/actions/gitversion/[email protected]
241+
with:
242+
versionSpec: ${{ env.GitVersion_Version }}
243+
244+
- name: GitVersion
245+
id: gitversion
246+
uses: gittools/actions/gitversion/[email protected]
247+
with:
248+
useConfigFile: true
249+
configFilePath: build/gitversion.yml
250+
216251
- name: Setup .NET SDK
217252
uses: actions/[email protected]
218253
with:
@@ -229,7 +264,7 @@ jobs:
229264
cd nuget
230265
ls -la
231266
find . -name '*.zip' -exec sh -c 'unzip -d "${1%.*}" "$1"' _ {} \;
232-
dotnet pack /p:OutputPath=$GITHUB_WORKSPACE/ci-output
267+
dotnet pack Uno.NETCore.App.Runtime.Mono.browser-wasm.csproj /p:OutputPath=$GITHUB_WORKSPACE/ci-output "/p:Version=${{ steps.gitversion.outputs.semVer }}"
233268
234269
- uses: actions/upload-artifact@v2
235270
if: ${{ always() }}

build/gitversion.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
assembly-versioning-scheme: MajorMinorPatch
2+
mode: Mainline
3+
4+
branches:
5+
main:
6+
mode: ContinuousDeployment
7+
regex: main
8+
tag: dev
9+
increment: Minor
10+
11+
pull-request:
12+
regex: ^(pull|pull\-requests|pr)[/-]
13+
mode: ContinuousDeployment
14+
tag: PullRequest
15+
increment: Inherit
16+
17+
stable:
18+
regex: release/stable/.*
19+
tag: ''
20+
increment: Patch
21+
source-branches: ['main']
22+
is-mainline: true
23+
24+
beta:
25+
mode: ContinuousDeployment
26+
regex: release/beta/.*
27+
tag: 'beta'
28+
increment: inherit
29+
source-branches: ['main']
30+
31+
dev:
32+
mode: ContinuousDeployment
33+
regex: dev/.*?/(.*?)
34+
tag: dev.{BranchName}
35+
source-branches: ['main', 'release', 'projects', 'feature']
36+
increment: inherit
37+
38+
projects:
39+
tag: proj-{BranchName}
40+
regex: projects/(.*?)
41+
source-branches: ['main']
42+
increment: inherit
43+
44+
feature:
45+
tag: feature.{BranchName}
46+
regex: feature/(.*?)
47+
source-branches: ['main']
48+
increment: inherit
49+
50+
ignore:
51+
sha: []

build/signing/SignClient.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"SignClient": {
3+
"AzureAd": {
4+
"AADInstance": "https://login.microsoftonline.com/",
5+
"ClientId": "80441c68-7fd8-4866-8dd1-8c78ff585a8a",
6+
"TenantId": "a297d6c0-b635-41a3-b1e3-558efe71e413"
7+
},
8+
"Service": {
9+
"Url": "https://uno-signservice.azurewebsites.net",
10+
"ResourceId": "https://SignService.platformuno.onmicrosoft.com/6dd8824b-6147-4b02-a1af-ea83b0ffebdb"
11+
}
12+
}
13+
}

build/signing/sign-package.ps1

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
$currentDirectory = split-path $MyInvocation.MyCommand.Definition
2+
3+
# See if we have the ClientSecret available
4+
if ([string]::IsNullOrEmpty($env:SignClientSecret)) {
5+
Write-Host "Client Secret not found, not signing packages"
6+
return;
7+
}
8+
9+
dotnet tool install --tool-path . SignClient
10+
11+
# Setup Variables we need to pass into the sign client tool
12+
$appSettings = "$currentDirectory\SignClient.json"
13+
14+
$filesToSign = Get-ChildItem -Recurse $Env:ArtifactDirectory\* -Include *.nupkg,*.vsix | Select-Object -ExpandProperty FullName
15+
16+
foreach ($fileToSign in $filesToSign) {
17+
Write-Host "Submitting $fileToSign for signing"
18+
.\SignClient 'sign' -c $appSettings -i $fileToSign -r $env:SignClientUser -s $env:SignClientSecret -n "$env:SignPackageName" -d "$env:SignPackageDescription" -u "$env:build_repository_uri"
19+
Write-Host "Finished signing $fileToSign"
20+
}
21+
22+
Write-Host "Sign-package complete"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
6+
<IsPackable>true</IsPackable>
7+
<IncludeBuildOutput>false</IncludeBuildOutput>
8+
<PackageProjectUrl>https://github.dev/unoplatform/Uno.DotnetRuntime.WebAssembly</PackageProjectUrl>
9+
<RepositoryUrl>https://github.dev/unoplatform/Uno.DotnetRuntime.WebAssembly</RepositoryUrl>
10+
<Description>.NET Ahead of Time Compiler for WebAssembly</Description>
11+
<Copyright>Copyright (C) 2015-$([System.DateTime]::Now.ToString(`yyyy`)) Uno Platform inc. - all rights reserved</Copyright>
12+
<NoWarn>NU5100;NU5128</NoWarn>
13+
<PackageId>Uno.NETCore.App.Runtime.AOT.$(NETCoreSdkPortableRuntimeIdentifier).Cross.browser-wasm</PackageId>
14+
</PropertyGroup>
15+
16+
<ItemGroup>
17+
<None Include="tools/**" Pack="true" PackagePath="tools" />
18+
</ItemGroup>
19+
20+
<Target Name="DownloadAndSetPackageIcon" BeforeTargets="_GetPackageFiles">
21+
<PropertyGroup>
22+
<IconUrl>https://uno-assets.platform.uno/logos/uno.png</IconUrl>
23+
</PropertyGroup>
24+
25+
<DownloadFile SourceUrl="$(IconUrl)" DestinationFolder="$(IntermediateOutputPath)">
26+
<Output TaskParameter="DownloadedFile" PropertyName="UnoPackageDownloadedIcon" />
27+
</DownloadFile>
28+
29+
<PropertyGroup>
30+
<PackageIcon>$([System.IO.Path]::GetFileName($(UnoPackageDownloadedIcon)))</PackageIcon>
31+
</PropertyGroup>
32+
33+
<ItemGroup>
34+
<None Include="$(UnoPackageDownloadedIcon)" Pack="true" PackagePath="\" Visible="false" />
35+
</ItemGroup>
36+
</Target>
37+
</Project>

0 commit comments

Comments
 (0)