Skip to content

Commit

Permalink
chore: Adjust build for AOT
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Aug 1, 2024
1 parent cc96aaf commit db0dc93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 40 deletions.
46 changes: 6 additions & 40 deletions .github/workflows/runtime-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ jobs:
##
## Build Job
##
build_windows_job:
build_aot_windows_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: windows-latest

strategy:
matrix:
BUILD_CONFIGURATION: [Release]
MONO_WASM_THREADS: ['multithread', 'singlethread']
MONO_WASM_SIMD: ['true', 'false']

steps:
- name: Setup .NET SDK
Expand All @@ -52,7 +50,6 @@ jobs:
echo "CurrentCommit=$CURRENT_COMMIT"
echo "BUILD_CONFIGURATION=${{ matrix.BUILD_CONFIGURATION }}" >> $env:GITHUB_ENV
echo "MONO_WASM_THREADS=${{ matrix.MONO_WASM_THREADS }}" >> $env:GITHUB_ENV
echo "MONO_WASM_SIMD=${{ matrix.MONO_WASM_SIMD }}" >> $env:GITHUB_ENV
- name: Clone dotnet/runtime
run: |
Expand All @@ -70,51 +67,25 @@ jobs:
run: |
$env:MonoEnableAssertMessages=true # enable emsdk assert messages
cd runtime
.\build.cmd -arch wasm -os browser -subset mono+libs /p:RuntimeFlavor=Mono -c $env:BUILD_CONFIGURATION $env:ADDITIONAL_BUILD_ARGS /p:TestAssemblies=false "/p:MonoWasmBuildVariant=$env:MONO_WASM_THREADS" "/p:WasmEnableSIMD=$MONO_WASM_SIMD" /p:CrossBuild=false /bl:ci-artifacts\msbuild.binlog
.\build.cmd -arch wasm -os browser -subset mono.runtime+libs.native /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: |
mkdir -p ./runtime/artifacts/packages/Release/Shipping
cd ./runtime/artifacts/packages/Release/Shipping
rm *.symbols.nupkg
rm *.Templates.*.nupkg
rm *ToolChain.net6.Manifest*.nupkg
rm *ToolChain.net7.Manifest*.nupkg
rm *ToolChain.net8.Manifest*.nupkg
# rename to zip as Expand-Archive does not support nupkg
gci -filter *.nupkg | Rename-Item -NewName { $_.name -replace "\.nupkg$", ".zip" }
Get-ChildItem . -Filter *.zip | Expand-Archive -DestinationPath uno -Force
cd uno
Remove-Item *.nuspec
Remove-Item *.nuspec
Remove-Item _rels -Recurse
Remove-Item package -Recurse
# Move cross compiler to appropriate location
move $env:GITHUB_WORKSPACE\runtime\artifacts\bin\mono\Browser.wasm.Release\cross runtimes\browser-wasm\native
- name: Copy ninja
run: |
Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip -OutFile ninja-win.zip
Expand-Archive -LiteralPath 'ninja-win.zip' -DestinationPath \runtime\artifacts\packages\Release\Shipping\uno\tools\ninja
- name: Zip Archive
run: |
if('${{ matrix.MONO_WASM_THREADS }}' -ne 'singlethread') {
$archiveConfiguration="-threads";
}
if('${{ matrix.MONO_WASM_SIMD }}' -ne 'false') {
$archiveConfiguration="$archiveConfiguration-simd";
}
Invoke-Expression "Get-Location | select -ExpandProperty Path" | Out-String -NoNewLine -OutVariable Current_Path
$ARTIFACTS_FOLDER="$Current_Path\ci-artifacts"
mkdir -p $ARTIFACTS_FOLDER
cd .\runtime\artifacts\packages\Release\Shipping\uno
Compress-Archive -DestinationPath $ARTIFACTS_FOLDER\dotnet-runtime-wasm-windows-$env:CURRENT_COMMIT-$env:BASE_DOTNET_SHORT_COMMIT-${{ github.run_id }}-$env:BUILD_CONFIGURATION$archiveConfiguration.zip -Path *
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 *
- uses: actions/upload-artifact@v2
if: ${{ always() }}
Expand All @@ -134,7 +105,6 @@ jobs:
matrix:
BUILD_CONFIGURATION: [Release]
MONO_WASM_THREADS: ['multithread', 'singlethread']
MONO_WASM_SIMD: ['true', 'false']

steps:
- name: Setup .NET SDK
Expand Down Expand Up @@ -183,7 +153,6 @@ jobs:
echo "CurrentCommit=$CURRENT_COMMIT"
echo "BUILD_CONFIGURATION=${{ matrix.BUILD_CONFIGURATION }}" >> $GITHUB_ENV
echo "MONO_WASM_THREADS=${{ matrix.MONO_WASM_THREADS }}" >> $GITHUB_ENV
echo "MONO_WASM_SIMD=${{ matrix.MONO_WASM_SIMD }}" >> $GITHUB_ENV
- name: Clone dotnet/runtime
run: |
Expand All @@ -203,7 +172,7 @@ jobs:
run: |
set -e
cd runtime
./build.sh -arch wasm -os browser -c $BUILD_CONFIGURATION $ADDITIONAL_BUILD_ARGS /p:TestAssemblies=false "/p:MonoWasmBuildVariant=$MONO_WASM_THREADS" "/p:WasmEnableSIMD=$MONO_WASM_SIMD"
./build.sh -arch wasm -os browser -c $BUILD_CONFIGURATION $ADDITIONAL_BUILD_ARGS /p:TestAssemblies=false "/p:MonoWasmBuildVariant=$MONO_WASM_THREADS"
- name: Create artifact structure
run: |
Expand Down Expand Up @@ -231,9 +200,6 @@ jobs:
if [ '${{ matrix.MONO_WASM_THREADS }}' != 'singlethread' ]; then
ARCHIVE_CONFIGURATION="-threads";
fi
if [ '${{ matrix.MONO_WASM_SIMD }}' != 'false' ]; then
ARCHIVE_CONFIGURATION="$ARCHIVE_CONFIGURATION-simd";
fi
ARTIFACTS_FOLDER=`pwd`/ci-artifacts
mkdir -p $ARTIFACTS_FOLDER
Expand All @@ -245,7 +211,7 @@ jobs:
with:
name: wasm
path: ci-artifacts

##
## Release Job
##
Expand Down
File renamed without changes.

0 comments on commit db0dc93

Please sign in to comment.