Build icu4c #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build icu4c | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: icu4c tag to build | |
required: true | |
php: | |
description: PHP version to build for | |
required: true | |
defaults: | |
run: | |
shell: cmd | |
jobs: | |
build: | |
strategy: | |
matrix: | |
arch: [x64, x86] | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout winlib-builder | |
uses: actions/checkout@v4 | |
with: | |
path: winlib-builder | |
- name: Checkout icu4c | |
uses: actions/checkout@v4 | |
with: | |
path: icu4c | |
repository: winlibs/icu4c | |
ref: ${{github.event.inputs.version}} | |
- name: Compute virtual inputs | |
id: virtuals | |
run: powershell winlib-builder/scripts/compute-virtuals -version ${{github.event.inputs.php}} -arch ${{matrix.arch}} | |
- name: Setup MSVC development environment | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{matrix.arch}} | |
toolset: ${{steps.virtuals.outputs.toolset}} | |
- name: Setup msbuild | |
uses: microsoft/setup-msbuild@v2 | |
- name: Remove UWP projects | |
run: | | |
cd icu4c\source\allinone | |
for /f %%i in ('dotnet sln allinone.sln list ^| findstr _uwp') do @dotnet sln allinone.sln remove %%i | |
- name: Build icu4c | |
run: cd icu4c && msbuild /p:Configuration=Release;Platform=${{steps.virtuals.outputs.msarch}};PlatformToolset=${{steps.virtuals.outputs.msts}};WindowsTargetPlatformVersion=${{steps.virtuals.outputs.winsdk}} source\allinone\allinone.sln | |
- name: Install icu4c | |
run: | | |
set WB_BINDIR=icu4c\bin | |
set WB_LIBDIR=icu4c\lib | |
if "${{matrix.arch}}" == "x64" ( | |
set WB_BINDIR=%WB_BINDIR%64 | |
set WB_LIBDIR=%WB_LIBDIR%64 | |
) | |
xcopy %WB_BINDIR%\* build\bin\* | |
del build\bin\*test*.dll build\bin\*test*.exe | |
xcopy /e icu4c\include\* build\include\* | |
xcopy %WB_LIBDIR%\* build\lib\* | |
del build\lib\*test*.* | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{github.event.inputs.version}}-${{steps.virtuals.outputs.vs}}-${{matrix.arch}} | |
path: build |