chore: Adjust for subset, pack nuget

This commit is contained in:
Jérôme Laban 2024-08-01 16:05:54 -04:00 коммит произвёл Jerome Laban
Родитель 58d0cd465b
Коммит 52ae62f5fe
3 изменённых файлов: 46 добавлений и 38 удалений

14
.github/workflows/runtime-ci.yml поставляемый
Просмотреть файл

@ -67,7 +67,7 @@ jobs:
run: |
$env:MonoEnableAssertMessages=true # enable emsdk assert messages
cd runtime
.\build.cmd -arch wasm -os browser -subset mono.wasmruntime+mono.aotcross /p:RuntimeFlavor=Mono -c $env:BUILD_CONFIGURATION $env:ADDITIONAL_BUILD_ARGS /p:TestAssemblies=false "/p:MonoWasmBuildVariant=$env:MONO_WASM_THREADS" /p:CrossBuild=false /bl:ci-artifacts\msbuild.binlog
.\build.cmd -arch wasm -os browser /p:RuntimeFlavor=Mono -c $env:BUILD_CONFIGURATION $env:ADDITIONAL_BUILD_ARGS /p:TestAssemblies=false "/p:MonoWasmBuildVariant=$env:MONO_WASM_THREADS" /p:CrossBuild=false /bl:ci-artifacts\msbuild.binlog
- name: Create artifact structure
run: |
@ -214,17 +214,21 @@ jobs:
with:
submodules: true
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: 8.0.303
- name: Download package
uses: actions/download-artifact@v2
with:
name: wasm-sdk
path: wasm-sdk
path: nuget
- name: Create NuGet SDK Packages
run: |
mkdir -p $GITHUB_WORKSPACE/ci-output
cd wasm-sdk
scripts/dedup.sh "$GITHUB_WORKSPACE/ci-output/sdk.zip"
cd nuget
dotnet pack /p:OutputPath=$GITHUB_WORKSPACE/ci-output
- uses: actions/upload-artifact@v2
if: ${{ always() }}

Просмотреть файл

@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IsPackable>true</IsPackable>
<IncludeBuildOutput>false</IncludeBuildOutput>
<PackageProjectUrl>https://github.dev/unoplatform/Uno.DotnetRuntime.WebAssembly</PackageProjectUrl>
<RepositoryUrl>https://github.dev/unoplatform/Uno.DotnetRuntime.WebAssembly</RepositoryUrl>
<Description>.NET SDK for WebAssembly</Description>
<Copyright>Copyright (C) 2015-$([System.DateTime]::Now.ToString(`yyyy`)) Uno Platform inc. - all rights reserved</Copyright>
<NoWarn>NU5100;NU5128</NoWarn>
</PropertyGroup>
<ItemGroup>
<None Include="sdk-multithread/**" Pack="true" PackagePath="data/multithread" />
<None Include="sdk-singlethread/**" Pack="true" PackagePath="data/singlethread " />
</ItemGroup>
<Target Name="DownloadAndSetPackageIcon" BeforeTargets="_GetPackageFiles">
<PropertyGroup>
<IconUrl>https://uno-assets.platform.uno/logos/uno.png</IconUrl>
</PropertyGroup>
<DownloadFile SourceUrl="$(IconUrl)" DestinationFolder="$(IntermediateOutputPath)">
<Output TaskParameter="DownloadedFile" PropertyName="UnoPackageDownloadedIcon" />
</DownloadFile>
<PropertyGroup>
<PackageIcon>$([System.IO.Path]::GetFileName($(UnoPackageDownloadedIcon)))</PackageIcon>
</PropertyGroup>
<ItemGroup>
<None Include="$(UnoPackageDownloadedIcon)" Pack="true" PackagePath="\" Visible="false" />
</ItemGroup>
</Target>
</Project>

Просмотреть файл

@ -1,33 +0,0 @@
#!/bin/bash
set -e
TOPDIR=$(pwd)
mkdir -p /tmp/uno-work
find . -name '*.zip' -exec sh -c 'unzip -d "/tmp/uno-work/${1%.*}" "$1"' _ {} \;
pushd /tmp/uno-work
DIR=$(pwd)
echo "Deduplicating files... in $DIR"
# Find and replace duplicates with symlinks
fdupes -r -1 "$DIR" | while read -r line; do
files=($line)
first=${files[0]}
for file in "${files[@]:1}"; do
rm "$file"
ln -s "$(realpath --relative-to="$(dirname "$file")" "$first")" "$file"
done
done
# Recompress the directory
zip -y -r "$1" "$DIR"
# Clean up
rm -rf "$DIR"
echo "Deduplicated zip file created: $1"
popd