-
Notifications
You must be signed in to change notification settings - Fork 592
82 lines (68 loc) · 2.9 KB
/
build-dotnet-packages.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
name: "Build .NET Packages"
on:
workflow_call:
workflow_dispatch:
jobs:
build-slice-compilers:
strategy:
matrix:
include:
- os: macos-latest
target: macos-arm64
artifact-path: cpp/bin/slice2cs
- os: windows-latest
target: windows-x64
artifact-path: cpp/bin/x64/Release/slice2cs.*
- os: ubuntu-24.04
target: linux-x64
artifact-path: cpp/bin/slice2cs
- os: ubuntu-24.04-arm
target: linux-arm64
artifact-path: cpp/bin/slice2cs
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Dependencies
uses: ./.github/actions/setup-dependencies
- name: Build Compiler
uses: ./.github/actions/build-slice-compiler
with:
compiler-name: slice2cs
- name: Upload Compiler Artifact
uses: actions/upload-artifact@v4
with:
name: slice2cs-${{ matrix.target }}
path: ${{ matrix.artifact-path }}
pack-dotnet:
runs-on: windows-latest
needs: build-slice-compilers
env:
SLICE2CS_STAGING_PATH: ${{ github.workspace }}\staging
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download All Compiler Artifacts
uses: actions/download-artifact@v4
- name: Copy slice2cs binaries to staging path
run: |
@("macos-arm64", "linux-x64", "linux-arm64", "windows-x64") | ForEach-Object { New-Item -ItemType Directory -Path $env:GITHUB_WORKSPACE\tools -Name $_ }
Copy-Item "slice2cs-macos-arm64\slice2cs" -Destination "$env:GITHUB_WORKSPACE\tools\macos-x64"
Copy-Item "slice2cs-linux-x64\slice2cs" -Destination "$env:GITHUB_WORKSPACE\tools\linux-x64"
Copy-Item "slice2cs-linux-arm64\slice2cs" -Destination "$env:GITHUB_WORKSPACE\tools\linux-arm64"
Copy-Item "slice2cs-windows-x64\slice2cs.exe" -Destination "$env:GITHUB_WORKSPACE\tools\windows-x64"
# Copy the compiler to the expected location to avoid rebuilding it when creating the NuGet packages
New-Item -ItemType Directory -Path "$env:GITHUB_WORKSPACE\cpp\bin\x64\Release"
Copy-Item "slice2cs-windows-x64\slice2cs.exe" -Destination "$env:GITHUB_WORKSPACE\cpp\bin\x64\Release"
# The .NET NuGet package includes bzip2 DLLs from the C++ Windows distribution for protocol compression
- name: Restore C++ dependencies
run: nuget restore cpp/msbuild/ice.sln
- name: Pack .NET Packages
run: dotnet msbuild csharp/msbuild/ice.proj /t:Pack /p:Configuration=Release /p:Platform=x64
- name: Upload NuGet Packages
uses: actions/upload-artifact@v4
with:
name: dotnet-nuget-packages
path: |
csharp/msbuild/zeroc.ice.net/*.nupkg
csharp/msbuild/zeroc.ice.net/*.snupkg